Skip to content

Commit

Permalink
update test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekluv committed Mar 28, 2017
1 parent ef8092b commit d66304a
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions tests/test_model_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1100,11 +1100,5 @@ class Meta:

UniqueChoiceModel.objects.create(name='choice1')
serializer = TestUniqueChoiceSerializer(data={'name': 'choice1'})
expected = dedent("""
TestUniqueChoiceSerializer():
id = IntegerField(label='ID', read_only=True)
name = ChoiceField(choices=(('choice1', 'choice 1'), ('choice2', 'choice 1')), validators=[<UniqueValidator(queryset=UniqueChoiceModel.objects.all())>])
""")
self.assertEqual(unicode_repr(TestUniqueChoiceSerializer()), expected)
assert not serializer.is_valid()
assert serializer.errors == {'name': ['unique choice model with this name already exists.']}

0 comments on commit d66304a

Please sign in to comment.