feat: enhance header context handling and add login page test
All checks were successful
Build and Push Docker Image / build (push) Successful in 25s
All checks were successful
Build and Push Docker Image / build (push) Successful in 25s
- Updated `header.html` to use `with` block for `active` context variable fallback - Added test to verify login page renders correctly without `active` context
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<!-- HEADER FRAGMENT -->
|
||||
{% with active=active|default:'' %}
|
||||
<header>
|
||||
<div class="container">
|
||||
<div class="header-top">
|
||||
@@ -72,3 +73,4 @@
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
{% endwith %}
|
||||
|
||||
@@ -12,6 +12,12 @@ User = get_user_model()
|
||||
|
||||
@override_settings(EMAIL_BACKEND="django.core.mail.backends.locmem.EmailBackend")
|
||||
class UserAuthFlowTests(TestCase):
|
||||
def test_login_page_renders_without_active_context(self):
|
||||
response = self.client.get(reverse("users:login"))
|
||||
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertTemplateUsed(response, "users/login.html")
|
||||
|
||||
def test_registration_creates_inactive_user_and_sends_activation_email(self):
|
||||
response = self.client.post(
|
||||
reverse("users:register"),
|
||||
|
||||
Reference in New Issue
Block a user