@@ -400,6 +400,17 @@ class PaginationTest(TestCase):
self.assertEqual(response.status_code, 200)
+@override_settings(ALLOWED_HOSTS=["testhost"])
+class SpecialSubmitterTest(TestCase):
+ def test_tab_shown_only_when_configured(self):
+ client = Client(HTTP_HOST="testhost")
+ self.assertNotContains(client.get("/Errors/Latest/"), "Latest Autobuilder errors")
+ with self.settings(SPECIAL_SUBMITTER={"name": "yocto-autobuilder",
+ "title": "Autobuilder",
+ "link": "Autobuilder"}):
+ self.assertContains(client.get("/Errors/Latest/"), "Latest Autobuilder errors")
+
+
@patch("Post.management.commands.culldb.time.sleep")
class CullDbTest(TestCase):
def setUp(self):
@@ -159,6 +159,7 @@ TEMPLATES = [
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
+ 'Post.views.common_context',
],
},
},
@@ -208,12 +209,6 @@ LOGGING = {
}
}
-TEMPLATE_CONTEXT_PROCESSORS = (
- 'django.contrib.auth.context_processors.auth',
- 'django.core.context_processors.request',
- 'Post.views.common_context',
-)
-
BUGZILLA_URL = 'https://bugzilla.yoctoproject.org'
ACCOUNT_ACTIVATION_DAYS = 2
@@ -153,6 +153,7 @@ TEMPLATES = [
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
+ 'Post.views.common_context',
],
},
},
@@ -202,12 +203,6 @@ LOGGING = {
}
}
-TEMPLATE_CONTEXT_PROCESSORS = (
- 'django.contrib.auth.context_processors.auth',
- 'django.core.context_processors.request',
- 'Post.views.common_context',
-)
-
BUGZILLA_URL = 'https://bugzilla.yoctoproject.org'
ACCOUNT_ACTIVATION_DAYS = 2
TEMPLATE_CONTEXT_PROCESSORS has been ignored since Django 1.10, so common_context never ran and the SPECIAL_SUBMITTER tab never showed. AI-Generated: Claude Opus 5.5 Signed-off-by: Tim Orling <tim.orling@konsulko.com> --- Post/test.py | 11 +++++++++++ project/settings.py | 7 +------ project/settings.py.docker | 7 +------ 3 files changed, 13 insertions(+), 12 deletions(-)