mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-24 23:19:47 +03:00
Demonstrate failing test for pk value as string.
This commit is contained in:
parent
517440004b
commit
5958feaa78
|
@ -174,7 +174,7 @@ class TestInstanceView(TestCase):
|
||||||
content = {'text': 'foobar'}
|
content = {'text': 'foobar'}
|
||||||
request = factory.put('/1', json.dumps(content),
|
request = factory.put('/1', json.dumps(content),
|
||||||
content_type='application/json')
|
content_type='application/json')
|
||||||
response = self.view(request, pk=1).render()
|
response = self.view(request, pk='1').render()
|
||||||
self.assertEquals(response.status_code, status.HTTP_200_OK)
|
self.assertEquals(response.status_code, status.HTTP_200_OK)
|
||||||
self.assertEquals(response.data, {'id': 1, 'text': 'foobar'})
|
self.assertEquals(response.data, {'id': 1, 'text': 'foobar'})
|
||||||
updated = self.objects.get(id=1)
|
updated = self.objects.get(id=1)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user