pull form master

This commit is contained in:
omid 2019-11-11 11:36:08 +03:30
parent 395596da31
commit 0c6e1feb71

View File

@ -3,19 +3,14 @@ from django.utils import translation
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from rest_framework.exceptions import ( from rest_framework.exceptions import (
<<<<<<< HEAD
ErrorDetail, Throttled, _get_error_details, ValidationError
=======
APIException, ErrorDetail, Throttled, _get_error_details, bad_request, APIException, ErrorDetail, Throttled, _get_error_details, bad_request,
server_error server_error, ValidationError
>>>>>>> 0d6589cf45940bb67ace74a06b2c5b053f1c31ef
) )
class ExceptionTestCase(TestCase): class ExceptionTestCase(TestCase):
def test_get_error_details(self): def test_get_error_details(self):
example = "string" example = "string"
lazy_example = _(example) lazy_example = _(example)
@ -79,9 +74,9 @@ class ErrorDetailTests(TestCase):
def test_repr(self): def test_repr(self):
assert repr(ErrorDetail('msg1')) == \ assert repr(ErrorDetail('msg1')) == \
'ErrorDetail(string={!r}, code=None)'.format('msg1') 'ErrorDetail(string={!r}, code=None)'.format('msg1')
assert repr(ErrorDetail('msg1', 'code')) == \ assert repr(ErrorDetail('msg1', 'code')) == \
'ErrorDetail(string={!r}, code={!r})'.format('msg1', 'code') 'ErrorDetail(string={!r}, code={!r})'.format('msg1', 'code')
def test_str(self): def test_str(self):
assert str(ErrorDetail('msg1')) == 'msg1' assert str(ErrorDetail('msg1')) == 'msg1'