Test for /api/web/account/user/
This commit is contained in:
parent
23759974d9
commit
6e4d2f738f
|
|
@ -5,7 +5,7 @@ from http.cookies import SimpleCookie
|
||||||
# Create your tests here.
|
# Create your tests here.
|
||||||
|
|
||||||
|
|
||||||
class AccountTests(APITestCase):
|
class AccountUserTests(APITestCase):
|
||||||
|
|
||||||
url = '/api/web/account/user/'
|
url = '/api/web/account/user/'
|
||||||
|
|
||||||
|
|
@ -23,3 +23,23 @@ class AccountTests(APITestCase):
|
||||||
response = self.client.get(self.url)
|
response = self.client.get(self.url)
|
||||||
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
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)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user