-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/gcivil-nyu-org/Wednesday…
…-Fall2023-Team-3 into update-filter-functionality
- Loading branch information
Showing
9 changed files
with
380 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,24 @@ | ||
# from django.test import TestCase | ||
from django.test import TestCase | ||
from django.urls import reverse | ||
from django.contrib.auth.models import User | ||
|
||
# Create your tests here. | ||
|
||
class LoginViewTestCase(TestCase): | ||
def setUp(self): | ||
# Create a user for testing login | ||
self.username = "testuser" | ||
self.password = "securepassword123" | ||
User.objects.create_user( | ||
self.username, email="test@example.com", password=self.password | ||
) | ||
|
||
def test_login_page_renders(self): | ||
# Test if login page renders correctly | ||
response = self.client.get(reverse("login")) | ||
self.assertEqual(response.status_code, 200) | ||
self.assertTemplateUsed(response, "registration/login.html") | ||
|
||
def test_form_displayed(self): | ||
# Test if the login form is in the context | ||
response = self.client.get(reverse("login")) | ||
self.assertIn("form", response.context) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.