Skip to content

Commit 9e427d9

Browse files
committed
fixed test test_key_in_post to have the correct content_type
1 parent 252bdbc commit 9e427d9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

example/tests/test_model_viewsets.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import json
22

3-
from example.tests import TestBase
4-
53
from django.contrib.auth import get_user_model
64
from django.utils import encoding
75
from django.core.urlresolvers import reverse
8-
from django.conf import settings
6+
7+
from example.tests import TestBase
98

109

1110
class ModelViewSetTests(TestBase):
@@ -167,7 +166,7 @@ def test_key_in_post(self):
167166
}
168167
}
169168
data_attributes = data['data']['attributes']
170-
response = self.client.put(self.detail_url, data=data, format='json')
169+
response = self.client.put(self.detail_url, content_type='application/vnd.api+json', data=json.dumps(data))
171170

172171
result = json.loads(response.content.decode('utf8'))
173172
result_attributes = result['data']['attributes']

0 commit comments

Comments
 (0)