add created field to test

This commit is contained in:
Paul Bailey 2017-11-13 16:06:07 +00:00
parent e05f41af40
commit 75e11a8195

View File

@ -10,6 +10,7 @@ from ..mutation import SerializerMutation
class MyFakeModel(models.Model): class MyFakeModel(models.Model):
cool_name = models.CharField(max_length=50) cool_name = models.CharField(max_length=50)
created = models.DateTimeField(auto_now_add=True)
class MyModelSerializer(serializers.ModelSerializer): class MyModelSerializer(serializers.ModelSerializer):
@ -71,6 +72,7 @@ def test_nested_model():
model_input_type = model_input._type.of_type model_input_type = model_input._type.of_type
assert issubclass(model_input_type, InputObjectType) assert issubclass(model_input_type, InputObjectType)
assert 'cool_name' in model_input_type._meta.fields assert 'cool_name' in model_input_type._meta.fields
assert 'created' in model_input_type._meta.fields
def test_mutate_and_get_payload_success(): def test_mutate_and_get_payload_success():