diff options
| author | Craig Blaszczyk | 2014-12-31 13:14:09 +0000 | 
|---|---|---|
| committer | Craig Blaszczyk | 2015-01-02 11:08:39 +0000 | 
| commit | 32506e20756c84677abb5ae49706446a0d250371 (patch) | |
| tree | 65df8a3195daa5f5df43c0bbea57cfb17df03dc8 /tests | |
| parent | a90ba2bc11de5fb391b95d4fce84f87ae7f88eff (diff) | |
| download | django-rest-framework-32506e20756c84677abb5ae49706446a0d250371.tar.bz2 | |
update expected error messages in tests
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_fields.py | 20 | 
1 files changed, 10 insertions, 10 deletions
| diff --git a/tests/test_fields.py b/tests/test_fields.py index 04c721d3..61d39aff 100644 --- a/tests/test_fields.py +++ b/tests/test_fields.py @@ -640,8 +640,8 @@ class TestDateField(FieldValues):          datetime.date(2001, 1, 1): datetime.date(2001, 1, 1),      }      invalid_inputs = { -        'abc': ['Date has wrong format. Use one of these formats instead: YYYY[-MM[-DD]]'], -        '2001-99-99': ['Date has wrong format. Use one of these formats instead: YYYY[-MM[-DD]]'], +        'abc': ['Date has wrong format. Use one of these formats instead: YYYY[-MM[-DD]].'], +        '2001-99-99': ['Date has wrong format. Use one of these formats instead: YYYY[-MM[-DD]].'],          datetime.datetime(2001, 1, 1, 12, 00): ['Expected a date but got a datetime.'],      }      outputs = { @@ -658,7 +658,7 @@ class TestCustomInputFormatDateField(FieldValues):          '1 Jan 2001': datetime.date(2001, 1, 1),      }      invalid_inputs = { -        '2001-01-01': ['Date has wrong format. Use one of these formats instead: DD [Jan-Dec] YYYY'] +        '2001-01-01': ['Date has wrong format. Use one of these formats instead: DD [Jan-Dec] YYYY.']      }      outputs = {}      field = serializers.DateField(input_formats=['%d %b %Y']) @@ -702,8 +702,8 @@ class TestDateTimeField(FieldValues):          '2001-01-01T14:00+01:00' if (django.VERSION > (1, 4)) else '2001-01-01T13:00Z': datetime.datetime(2001, 1, 1, 13, 00, tzinfo=timezone.UTC())      }      invalid_inputs = { -        'abc': ['Datetime has wrong format. Use one of these formats instead: YYYY-MM-DDThh:mm[:ss[.uuuuuu]][+HH:MM|-HH:MM|Z]'], -        '2001-99-99T99:00': ['Datetime has wrong format. Use one of these formats instead: YYYY-MM-DDThh:mm[:ss[.uuuuuu]][+HH:MM|-HH:MM|Z]'], +        'abc': ['Datetime has wrong format. Use one of these formats instead: YYYY-MM-DDThh:mm[:ss[.uuuuuu]][+HH:MM|-HH:MM|Z].'], +        '2001-99-99T99:00': ['Datetime has wrong format. Use one of these formats instead: YYYY-MM-DDThh:mm[:ss[.uuuuuu]][+HH:MM|-HH:MM|Z].'],          datetime.date(2001, 1, 1): ['Expected a datetime but got a date.'],      }      outputs = { @@ -721,7 +721,7 @@ class TestCustomInputFormatDateTimeField(FieldValues):          '1:35pm, 1 Jan 2001': datetime.datetime(2001, 1, 1, 13, 35, tzinfo=timezone.UTC()),      }      invalid_inputs = { -        '2001-01-01T20:50': ['Datetime has wrong format. Use one of these formats instead: hh:mm[AM|PM], DD [Jan-Dec] YYYY'] +        '2001-01-01T20:50': ['Datetime has wrong format. Use one of these formats instead: hh:mm[AM|PM], DD [Jan-Dec] YYYY.']      }      outputs = {}      field = serializers.DateTimeField(default_timezone=timezone.UTC(), input_formats=['%I:%M%p, %d %b %Y']) @@ -773,8 +773,8 @@ class TestTimeField(FieldValues):          datetime.time(13, 00): datetime.time(13, 00),      }      invalid_inputs = { -        'abc': ['Time has wrong format. Use one of these formats instead: hh:mm[:ss[.uuuuuu]]'], -        '99:99': ['Time has wrong format. Use one of these formats instead: hh:mm[:ss[.uuuuuu]]'], +        'abc': ['Time has wrong format. Use one of these formats instead: hh:mm[:ss[.uuuuuu]].'], +        '99:99': ['Time has wrong format. Use one of these formats instead: hh:mm[:ss[.uuuuuu]].'],      }      outputs = {          datetime.time(13, 00): '13:00:00' @@ -790,7 +790,7 @@ class TestCustomInputFormatTimeField(FieldValues):          '1:00pm': datetime.time(13, 00),      }      invalid_inputs = { -        '13:00': ['Time has wrong format. Use one of these formats instead: hh:mm[AM|PM]'], +        '13:00': ['Time has wrong format. Use one of these formats instead: hh:mm[AM|PM].'],      }      outputs = {}      field = serializers.TimeField(input_formats=['%I:%M%p']) @@ -1028,7 +1028,7 @@ class TestListField(FieldValues):          (['1', '2', '3'], [1, 2, 3])      ]      invalid_inputs = [ -        ('not a list', ['Expected a list of items but got type `str`']), +        ('not a list', ['Expected a list of items but got type `str`.']),          ([1, 2, 'error'], ['A valid integer is required.'])      ]      outputs = [ | 
