converted metadata test asserts to pytest (#4806)

This commit is contained in:
Asif Saifuddin Auvi 2017-01-12 14:21:15 +06:00 committed by Tom Christie
parent dd11bd42a2
commit 8fcb8d6350

View File

@ -268,7 +268,7 @@ class TestSimpleMetadataFieldInfo(TestCase):
def test_null_boolean_field_info_type(self): def test_null_boolean_field_info_type(self):
options = metadata.SimpleMetadata() options = metadata.SimpleMetadata()
field_info = options.get_field_info(serializers.NullBooleanField()) field_info = options.get_field_info(serializers.NullBooleanField())
self.assertEqual(field_info['type'], 'boolean') assert field_info['type'] == 'boolean'
def test_related_field_choices(self): def test_related_field_choices(self):
options = metadata.SimpleMetadata() options = metadata.SimpleMetadata()
@ -277,7 +277,7 @@ class TestSimpleMetadataFieldInfo(TestCase):
field_info = options.get_field_info( field_info = options.get_field_info(
serializers.RelatedField(queryset=BasicModel.objects.all()) serializers.RelatedField(queryset=BasicModel.objects.all())
) )
self.assertNotIn('choices', field_info) assert 'choices' not in field_info
class TestModelSerializerMetadata(TestCase): class TestModelSerializerMetadata(TestCase):