Skip to content

Commit

Permalink
Merge branch 'boolean-field-required-1004' of git://github.com/willkg…
Browse files Browse the repository at this point in the history
…/django-rest-framework
  • Loading branch information
tomchristie committed Aug 19, 2013
2 parents 28ff6fb + 430f008 commit 7cc1d38
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rest_framework/tests/test_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -896,3 +896,12 @@ class Meta:
self.assertFalse(serializer.is_valid())


class BooleanField(TestCase):
"""
Tests for BooleanField
"""
def test_boolean_required(self):
class BooleanRequiredSerializer(serializers.Serializer):
bool_field = serializers.BooleanField(required=True)

self.assertFalse(BooleanRequiredSerializer(data={}).is_valid())

0 comments on commit 7cc1d38

Please sign in to comment.