profile: rename multiple var and change to use
django rest frameword
This commit is contained in:
@ -7,11 +7,12 @@ class ProfileTest(TestCase):
|
||||
def setUp(self):
|
||||
self.user: User = User.objects.create(username='bozo', password='password')
|
||||
self.user.save()
|
||||
self.expected_response = {"username": "bozo",
|
||||
self.expected_response = {"name": "bozo",
|
||||
"title": ""}
|
||||
self.url = "/profiles/"
|
||||
|
||||
def test_profile_create_on_user_created(self):
|
||||
response: HttpResponse = self.client.get(f"/api/profiles/{self.user.pk}")
|
||||
response: HttpResponse = self.client.get(self.url + str(self.user.pk))
|
||||
response_dict: dict = eval(response.content)
|
||||
self.assertEqual(self.expected_response, response_dict)
|
||||
self.assertDictEqual(self.expected_response, response_dict)
|
||||
|
Reference in New Issue
Block a user