From 6e4d2f738fa29a74503fdbe6bee47ab04ccb3c5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B8=D0=BA=D1=82=D0=BE=D1=80=20=D0=93=D0=BB=D0=B0?= =?UTF-8?q?=D0=B4=D0=BA=D0=B8=D1=85?= Date: Mon, 23 Sep 2019 16:18:36 +0300 Subject: [PATCH] Test for /api/web/account/user/ --- apps/account/tests/tests_common.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/apps/account/tests/tests_common.py b/apps/account/tests/tests_common.py index 2e66b330..c92fe89e 100644 --- a/apps/account/tests/tests_common.py +++ b/apps/account/tests/tests_common.py @@ -5,7 +5,7 @@ from http.cookies import SimpleCookie # Create your tests here. -class AccountTests(APITestCase): +class AccountUserTests(APITestCase): url = '/api/web/account/user/' @@ -23,3 +23,23 @@ class AccountTests(APITestCase): response = self.client.get(self.url) self.assertEqual(response.status_code, status.HTTP_200_OK) + data = { + "username": self.data["username"], + "first_name": "Test first name", + "last_name": "Test last name", + "cropped_image_url": "http://localhost/image/cropped.png", + "image_url": "http://localhost/image/avatar.png", + "email": "sedragurdatest@desoz.com", + "newsletter": self.data["newsletter"] + } + response = self.client.patch(self.url, data=data, format='json') + self.assertEqual(response.status_code, status.HTTP_200_OK) + + data["email"] = "sedragurdatest2@desoz.com" + + response = self.client.put(self.url, data=data, format='json') + self.assertEqual(response.status_code, status.HTTP_200_OK) + + + +