Add flake8-bugbear to pre-commit.
This commit is contained in:
@@ -75,7 +75,7 @@ class AdminInterfaceModelsTestCase(TestCase):
|
||||
theme_4 = Theme.objects.create(name="Custom 4", active=True)
|
||||
theme_5 = Theme.objects.create(name="Custom 5", active=True)
|
||||
themes = [theme_1, theme_2, theme_3, theme_4, theme_5]
|
||||
for i in range(5):
|
||||
for _ in range(5):
|
||||
random.shuffle(themes)
|
||||
for theme in themes:
|
||||
theme.set_active()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from django.test import TestCase
|
||||
from django.test.testcases import DatabaseOperationForbidden
|
||||
|
||||
from admin_interface.models import Theme
|
||||
|
||||
@@ -22,7 +23,7 @@ class AdminInterfaceModelsWithDBRoutingTestCase(TestCase):
|
||||
assert db_for_theme == "replica"
|
||||
|
||||
def test_dbrouter_errors_when_fetching_from_default(self):
|
||||
with self.assertRaises(Exception):
|
||||
with self.assertRaises(DatabaseOperationForbidden):
|
||||
Theme.objects.get_active()
|
||||
|
||||
def test_dbrouter_fetches_db(self):
|
||||
|
||||
Reference in New Issue
Block a user