mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-27 16:40:03 +03:00
Combine the nullable boolean field test cases
'NullBooleanField' is now based on 'BooleanField(allow_null=True)' and doesn't need a test case to explicitly test its behavior.
This commit is contained in:
parent
3812f46c19
commit
8de2fed468
|
@ -673,9 +673,9 @@ class TestBooleanField(FieldValues):
|
||||||
assert exc_info.value.detail == expected
|
assert exc_info.value.detail == expected
|
||||||
|
|
||||||
|
|
||||||
class TestNullBooleanField(TestBooleanField):
|
class TestNullableBooleanField(TestBooleanField):
|
||||||
"""
|
"""
|
||||||
Valid and invalid values for `NullBooleanField`.
|
Valid and invalid values for `BooleanField(allow_null=True)`.
|
||||||
"""
|
"""
|
||||||
valid_inputs = {
|
valid_inputs = {
|
||||||
'true': True,
|
'true': True,
|
||||||
|
@ -697,17 +697,7 @@ class TestNullBooleanField(TestBooleanField):
|
||||||
None: None,
|
None: None,
|
||||||
'other': True
|
'other': True
|
||||||
}
|
}
|
||||||
field = serializers.NullBooleanField()
|
field = serializers.BooleanField(allow_null=True)
|
||||||
|
|
||||||
|
|
||||||
class TestNullableBooleanField(TestNullBooleanField):
|
|
||||||
"""
|
|
||||||
Valid and invalid values for `BooleanField` when `allow_null=True`.
|
|
||||||
"""
|
|
||||||
|
|
||||||
@property
|
|
||||||
def field(self):
|
|
||||||
return serializers.BooleanField(allow_null=True)
|
|
||||||
|
|
||||||
|
|
||||||
# String types...
|
# String types...
|
||||||
|
|
Loading…
Reference in New Issue
Block a user