Skip to content

Commit 49128db

Browse files
committed
Update m2m test to call PATCH twice and verify that everything looks good
1 parent d2ec8d4 commit 49128db

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

example/tests/test_views.py

+7
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,13 @@ def test_patch_many_to_many_relationship(self):
152152
response = self.client.get(url)
153153
assert response.data == request_data['data']
154154

155+
response = self.client.patch(url, data=request_data)
156+
assert response.status_code == 200, response.content.decode()
157+
assert response.data == request_data['data']
158+
159+
response = self.client.get(url)
160+
assert response.data == request_data['data']
161+
155162
def test_post_to_one_relationship_should_fail(self):
156163
url = '/entries/{}/relationships/blog'.format(self.first_entry.id)
157164
request_data = {

0 commit comments

Comments
 (0)