mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-25 19:14:01 +03:00
Refactor reverse tests style
This commit is contained in:
parent
401ab54275
commit
bd86104861
|
@ -38,18 +38,18 @@ class ReverseTests(TestCase):
|
|||
def test_reversed_urls_are_fully_qualified(self):
|
||||
request = factory.get('/view')
|
||||
url = reverse('view', request=request)
|
||||
self.assertEqual(url, 'http://testserver/view')
|
||||
assert url == 'http://testserver/view'
|
||||
|
||||
def test_reverse_with_versioning_scheme(self):
|
||||
request = factory.get('/view')
|
||||
request.versioning_scheme = MockVersioningScheme()
|
||||
|
||||
url = reverse('view', request=request)
|
||||
self.assertEqual(url, 'http://scheme-reversed/view')
|
||||
assert url == 'http://scheme-reversed/view'
|
||||
|
||||
def test_reverse_with_versioning_scheme_fallback_to_default_on_error(self):
|
||||
request = factory.get('/view')
|
||||
request.versioning_scheme = MockVersioningScheme(raise_error=True)
|
||||
|
||||
url = reverse('view', request=request)
|
||||
self.assertEqual(url, 'http://testserver/view')
|
||||
assert url == 'http://testserver/view'
|
||||
|
|
Loading…
Reference in New Issue
Block a user