mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 00:04:16 +03:00
Update one-to-one test names
This commit is contained in:
parent
e66eeb4af8
commit
46eea97380
|
@ -47,7 +47,7 @@ class NestedOneToOneTests(TestCase):
|
||||||
source = OneToOneSource(name='source-%d' % idx, target_source=target_source)
|
source = OneToOneSource(name='source-%d' % idx, target_source=target_source)
|
||||||
source.save()
|
source.save()
|
||||||
|
|
||||||
def test_foreign_key_retrieve(self):
|
def test_one_to_one_retrieve(self):
|
||||||
queryset = OneToOneTarget.objects.all()
|
queryset = OneToOneTarget.objects.all()
|
||||||
serializer = OneToOneTargetSerializer(queryset)
|
serializer = OneToOneTargetSerializer(queryset)
|
||||||
expected = [
|
expected = [
|
||||||
|
@ -58,7 +58,7 @@ class NestedOneToOneTests(TestCase):
|
||||||
self.assertEquals(serializer.data, expected)
|
self.assertEquals(serializer.data, expected)
|
||||||
|
|
||||||
|
|
||||||
def test_foreign_key_create(self):
|
def test_one_to_one_create(self):
|
||||||
data = {'id': 4, 'name': u'target-4', 'target_source': {'id': 4, 'name': u'target-source-4', 'source': {'id': 4, 'name': u'source-4'}}}
|
data = {'id': 4, 'name': u'target-4', 'target_source': {'id': 4, 'name': u'target-source-4', 'source': {'id': 4, 'name': u'source-4'}}}
|
||||||
serializer = OneToOneTargetSerializer(data=data)
|
serializer = OneToOneTargetSerializer(data=data)
|
||||||
self.assertTrue(serializer.is_valid())
|
self.assertTrue(serializer.is_valid())
|
||||||
|
@ -77,7 +77,7 @@ class NestedOneToOneTests(TestCase):
|
||||||
]
|
]
|
||||||
self.assertEquals(serializer.data, expected)
|
self.assertEquals(serializer.data, expected)
|
||||||
|
|
||||||
def test_foreign_key_create_with_invalid_data(self):
|
def test_one_to_one_create_with_invalid_data(self):
|
||||||
data = {'id': 4, 'name': u'target-4', 'target_source': {'id': 4, 'name': u'target-source-4', 'source': {'id': 4}}}
|
data = {'id': 4, 'name': u'target-4', 'target_source': {'id': 4, 'name': u'target-source-4', 'source': {'id': 4}}}
|
||||||
serializer = OneToOneTargetSerializer(data=data)
|
serializer = OneToOneTargetSerializer(data=data)
|
||||||
self.assertFalse(serializer.is_valid())
|
self.assertFalse(serializer.is_valid())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user