mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 00:04:16 +03:00
Merge pull request #2992 from linovia/feature/clean_mock_html_dir
Remove an extra MockHTMLDict definition.
This commit is contained in:
commit
0fdaa0dbba
|
@ -221,6 +221,14 @@ class TestInvalidErrorKey:
|
||||||
assert str(exc_info.value) == expected
|
assert str(exc_info.value) == expected
|
||||||
|
|
||||||
|
|
||||||
|
class MockHTMLDict(dict):
|
||||||
|
"""
|
||||||
|
This class mocks up a dictionary like object, that behaves
|
||||||
|
as if it was returned for multipart or urlencoded data.
|
||||||
|
"""
|
||||||
|
getlist = None
|
||||||
|
|
||||||
|
|
||||||
class TestBooleanHTMLInput:
|
class TestBooleanHTMLInput:
|
||||||
def setup(self):
|
def setup(self):
|
||||||
class TestSerializer(serializers.Serializer):
|
class TestSerializer(serializers.Serializer):
|
||||||
|
@ -234,21 +242,11 @@ class TestBooleanHTMLInput:
|
||||||
"""
|
"""
|
||||||
# This class mocks up a dictionary like object, that behaves
|
# This class mocks up a dictionary like object, that behaves
|
||||||
# as if it was returned for multipart or urlencoded data.
|
# as if it was returned for multipart or urlencoded data.
|
||||||
class MockHTMLDict(dict):
|
|
||||||
getlist = None
|
|
||||||
serializer = self.Serializer(data=MockHTMLDict())
|
serializer = self.Serializer(data=MockHTMLDict())
|
||||||
assert serializer.is_valid()
|
assert serializer.is_valid()
|
||||||
assert serializer.validated_data == {'archived': False}
|
assert serializer.validated_data == {'archived': False}
|
||||||
|
|
||||||
|
|
||||||
class MockHTMLDict(dict):
|
|
||||||
"""
|
|
||||||
This class mocks up a dictionary like object, that behaves
|
|
||||||
as if it was returned for multipart or urlencoded data.
|
|
||||||
"""
|
|
||||||
getlist = None
|
|
||||||
|
|
||||||
|
|
||||||
class TestHTMLInput:
|
class TestHTMLInput:
|
||||||
def test_empty_html_charfield(self):
|
def test_empty_html_charfield(self):
|
||||||
class TestSerializer(serializers.Serializer):
|
class TestSerializer(serializers.Serializer):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user