mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-06-15 19:13:33 +03:00
converted asserts of exceptions test to pytest (#4723)
This commit is contained in:
parent
6e30dc75e0
commit
1a741bb2a2
|
@ -16,28 +16,22 @@ class ExceptionTestCase(TestCase):
|
||||||
example = "string"
|
example = "string"
|
||||||
lazy_example = _(example)
|
lazy_example = _(example)
|
||||||
|
|
||||||
self.assertEqual(
|
assert _get_error_details(lazy_example) == example
|
||||||
_get_error_details(lazy_example),
|
|
||||||
example
|
|
||||||
)
|
|
||||||
assert isinstance(
|
assert isinstance(
|
||||||
_get_error_details(lazy_example),
|
_get_error_details(lazy_example),
|
||||||
ErrorDetail
|
ErrorDetail
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(
|
assert _get_error_details({'nested': lazy_example})['nested'] == example
|
||||||
_get_error_details({'nested': lazy_example})['nested'],
|
|
||||||
example
|
|
||||||
)
|
|
||||||
assert isinstance(
|
assert isinstance(
|
||||||
_get_error_details({'nested': lazy_example})['nested'],
|
_get_error_details({'nested': lazy_example})['nested'],
|
||||||
ErrorDetail
|
ErrorDetail
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(
|
assert _get_error_details([[lazy_example]])[0][0] == example
|
||||||
_get_error_details([[lazy_example]])[0][0],
|
|
||||||
example
|
|
||||||
)
|
|
||||||
assert isinstance(
|
assert isinstance(
|
||||||
_get_error_details([[lazy_example]])[0][0],
|
_get_error_details([[lazy_example]])[0][0],
|
||||||
ErrorDetail
|
ErrorDetail
|
||||||
|
|
Loading…
Reference in New Issue
Block a user