Commit a35711b1 authored by Jean-samuel TETTEKPOE's avatar Jean-samuel TETTEKPOE
Browse files

Solve cannot post None type

parent 70ec556b
......@@ -299,7 +299,7 @@ class AccountTests(APITestCase):
def test_change_account(self):
# Unauthenticated
response = self.client.put('/account/%d/?bar=natationjone' % self.account.id, self.update_data)
response = self.client.put('/account/%d/?bar=natationjone' % self.account.id, self.update_data, content_type="application/json")
self.assertEqual(response.status_code, 401)
self.account.refresh_from_db()
self.assertEqual(self.account.deleted, self.account.deleted)
......@@ -307,7 +307,7 @@ class AccountTests(APITestCase):
def test_change_account2(self):
# Wrong permissions
self.client.force_authenticate(user=self.user)
response = self.client.put('/account/%d/?bar=natationjone' % self.account.id, self.update_data)
response = self.client.put('/account/%d/?bar=natationjone' % self.account.id, self.update_data, content_type="application/json")
self.assertEqual(response.status_code, 403)
self.account.refresh_from_db()
self.assertEqual(self.account.deleted, self.account.deleted)
......@@ -315,7 +315,7 @@ class AccountTests(APITestCase):
def test_change_account4(self):
# Correct permissions
self.client.force_authenticate(user=self.user2)
response = self.client.put('/account/%d/?bar=natationjone' % self.account.id, self.update_data)
response = self.client.put('/account/%d/?bar=natationjone' % self.account.id, self.update_data, content_type="application/json")
self.assertEqual(response.status_code, 200)
self.account.refresh_from_db()
self.assertEqual(self.account.deleted, self.update_data['deleted'])
......@@ -323,7 +323,7 @@ class AccountTests(APITestCase):
def test_change_account5(self):
# Wrong bar
self.client.force_authenticate(user=self.user2)
response = self.client.put('/account/%d/?bar=avironjone' % self.account.id, self.update_data)
response = self.client.put('/account/%d/?bar=avironjone' % self.account.id, self.update_data, content_type="application/json")
self.assertEqual(response.status_code, 403)
self.account.refresh_from_db()
self.assertEqual(self.account.deleted, self.account.deleted)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment