Commit d797389c by Kevin Brown

Fixed broken test for Django < 1.9

This test was incorrectly checking that there were no validators set in
older versions of Django, even though it should have been checking for
the two validators that were set up on the model field level.

The originally regression test that this fixes was added in
https://github.com/tomchristie/django-rest-framework/commit/7d79cf35b7be01b175d8c25276a4414e8144a16b
when fixing an issue with the `DecimalValidator`.
parent 87605e1e
...@@ -884,7 +884,7 @@ class TestDecimalFieldMappings(TestCase): ...@@ -884,7 +884,7 @@ class TestDecimalFieldMappings(TestCase):
serializer = TestSerializer() serializer = TestSerializer()
assert len(serializer.fields['decimal_field'].validators) == 0 assert len(serializer.fields['decimal_field'].validators) == 2
@pytest.mark.skipif(DecimalValidator is None, @pytest.mark.skipif(DecimalValidator is None,
reason='DecimalValidator is available in Django 1.9+') reason='DecimalValidator is available in Django 1.9+')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment