Add flake8-bugbear to pre-commit.

This commit is contained in:
Fabio Caccamo
2023-03-01 17:54:58 +01:00
parent 522e4d20bc
commit 4deefc20b7
5 changed files with 11 additions and 4 deletions
+1 -1
View File
@@ -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()
+2 -1
View File
@@ -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):