mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-15 18:52:27 +03:00
fix: using pytest.fail to test
This commit is contained in:
parent
1977c5b575
commit
40465d95c5
|
@ -2093,9 +2093,7 @@ class TestMultipleChoiceField(FieldValues):
|
||||||
try:
|
try:
|
||||||
json.dumps(validated)
|
json.dumps(validated)
|
||||||
except TypeError as e:
|
except TypeError as e:
|
||||||
assert (
|
pytest.fail(f'Validated output not JSON serializable: {repr(validated)}; Error: {e}')
|
||||||
False
|
|
||||||
), f'Validated output not JSON serializable: {repr(validated)}; Error: {e}'
|
|
||||||
|
|
||||||
def test_output_is_json_serializable(self):
|
def test_output_is_json_serializable(self):
|
||||||
for output_value, _ in get_items(self.outputs):
|
for output_value, _ in get_items(self.outputs):
|
||||||
|
@ -2104,7 +2102,7 @@ class TestMultipleChoiceField(FieldValues):
|
||||||
try:
|
try:
|
||||||
json.dumps(representation)
|
json.dumps(representation)
|
||||||
except TypeError as e:
|
except TypeError as e:
|
||||||
assert False, (
|
pytest.fail(
|
||||||
f'to_representation output not JSON serializable: '
|
f'to_representation output not JSON serializable: '
|
||||||
f'{repr(representation)}; Error: {e}'
|
f'{repr(representation)}; Error: {e}'
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user