Skip to content

Commit

Permalink
Adjusted super() call in URLPatternsTestCase.setUpClass()
Browse files Browse the repository at this point in the history
Failed after django/django@faba5b7
unless super() call is first.

Thanks to Mariusz Felisiak and Tom Christie for review.
  • Loading branch information
carltongibson committed Sep 23, 2021
1 parent f651878 commit 8eefb21
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rest_framework/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,8 @@ def test_something_else(self):
"""
@classmethod
def setUpClass(cls):
super().setUpClass()

# Get the module of the TestCase subclass
cls._module = import_module(cls.__module__)
cls._override = override_settings(ROOT_URLCONF=cls.__module__)
Expand All @@ -385,7 +387,6 @@ def setUpClass(cls):
cls._module.urlpatterns = cls.urlpatterns

cls._override.enable()
super().setUpClass()

@classmethod
def tearDownClass(cls):
Expand Down

0 comments on commit 8eefb21

Please sign in to comment.