profile: rename multiple var and change to use

django rest frameword
This commit is contained in:
2023-11-12 00:03:08 +01:00
parent a7d9471d59
commit b9728dcb06
5 changed files with 22 additions and 23 deletions

View File

@ -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)