sort on code

This commit is contained in:
omid 2019-11-11 11:38:42 +03:30
parent 0c6e1feb71
commit c1a8556695
3 changed files with 6 additions and 8 deletions

View File

@ -114,4 +114,4 @@ if __name__ == "__main__":
exit_on_failure(flake8_main(FLAKE8_ARGS))
if run_isort:
exit_on_failure(isort_main(ISORT_ARGS))
exit_on_failure(isort_main(ISORT_ARGS))

View File

@ -110,4 +110,4 @@ setup(
# Doing so helps ensure your question is helpful to other users.
# Queries directly to my email are likely to receive a canned response.
#
# Many thanks for your understanding.
# Many thanks for your understanding.

View File

@ -3,8 +3,8 @@ from django.utils import translation
from django.utils.translation import gettext_lazy as _
from rest_framework.exceptions import (
APIException, ErrorDetail, Throttled, _get_error_details, bad_request,
server_error, ValidationError
APIException, ErrorDetail, Throttled, ValidationError, _get_error_details,
bad_request, server_error
)
@ -73,10 +73,8 @@ class ErrorDetailTests(TestCase):
assert ErrorDetail('msg1', 'code') != 'msg2'
def test_repr(self):
assert repr(ErrorDetail('msg1')) == \
'ErrorDetail(string={!r}, code=None)'.format('msg1')
assert repr(ErrorDetail('msg1', 'code')) == \
'ErrorDetail(string={!r}, code={!r})'.format('msg1', 'code')
assert repr(ErrorDetail('msg1')) == 'ErrorDetail(string={!r}, code=None)'.format('msg1')
assert repr(ErrorDetail('msg1', 'code')) == 'ErrorDetail(string={!r}, code={!r})'.format('msg1', 'code')
def test_str(self):
assert str(ErrorDetail('msg1')) == 'msg1'