From ae60981a08271ebb9eeea0ce4c821be59bc24879 Mon Sep 17 00:00:00 2001 From: Elahi-cs Date: Mon, 27 Nov 2023 11:26:23 +0100 Subject: [PATCH] Changed testing mail domain to @example.org to avoid potential spamming --- idhub/tests/test_models.py | 2 +- idhub/tests/test_tables.py | 4 ++-- idhub/tests/test_templates.py | 4 ++-- idhub/tests/test_views.py | 12 ++++++------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/idhub/tests/test_models.py b/idhub/tests/test_models.py index 1709861..62bcdb3 100644 --- a/idhub/tests/test_models.py +++ b/idhub/tests/test_models.py @@ -6,7 +6,7 @@ from idhub_auth.models import User class EventModelTest(TestCase): @classmethod def setUpTestData(cls): - user = User.objects.create(email='testuser@email.com') + user = User.objects.create(email='testuser@example.org') Event.objects.create(message='Test Event', type=1, user=user) def test_event_creation(self): diff --git a/idhub/tests/test_tables.py b/idhub/tests/test_tables.py index cde5acb..a78fde9 100644 --- a/idhub/tests/test_tables.py +++ b/idhub/tests/test_tables.py @@ -11,7 +11,7 @@ from idhub.models import Event class AdminDashboardTableTest(TestCase): def setUp(self): self.admin_user = User.objects.create_superuser( - email='adminuser@mail.com', + email='adminuser@example.org', password='adminpass12') @classmethod @@ -41,7 +41,7 @@ class AdminDashboardTableTest(TestCase): < sorted_records[2].record.created) def test_table_in_template(self): - self.client.login(email='adminuser@mail.com', password='adminpass12') + self.client.login(email='adminuser@example.org', password='adminpass12') response = self.client.get(reverse('idhub:admin_dashboard')) self.assertTemplateUsed(response, 'idhub/custom_table.html') diff --git a/idhub/tests/test_templates.py b/idhub/tests/test_templates.py index d04e0ca..c1b8f3c 100644 --- a/idhub/tests/test_templates.py +++ b/idhub/tests/test_templates.py @@ -8,11 +8,11 @@ class TemplateTest(TestCase): def setUp(self): self.client = Client() self.admin_user = User.objects.create_superuser( - email='adminuser@mail.com', + email='adminuser@example.org', password='adminpass12') def test_dashboard_template(self): - self.client.login(email='adminuser@mail.com', password='adminpass12') + self.client.login(email='adminuser@example.org', password='adminpass12') response = self.client.get(reverse('idhub:admin_dashboard')) self.assertEqual(response.status_code, 200) self.assertTemplateUsed(response, 'idhub/base_admin.html') diff --git a/idhub/tests/test_views.py b/idhub/tests/test_views.py index ee5f3f4..cb9bbd5 100644 --- a/idhub/tests/test_views.py +++ b/idhub/tests/test_views.py @@ -7,10 +7,10 @@ from idhub_auth.models import User class AdminDashboardViewTest(TestCase): def setUp(self): - self.user = User.objects.create_user(email='normaluser@mail.com', + self.user = User.objects.create_user(email='normaluser@example.org', password='testpass12') self.admin_user = User.objects.create_superuser( - email='adminuser@mail.com', + email='adminuser@example.org', password='adminpass12') def test_view_url_exists_at_desired_location(self): @@ -25,26 +25,26 @@ class AdminDashboardViewTest(TestCase): self.assertTemplateUsed(response, 'auth/login.html') def test_view_redirects_on_incorrect_login_attempt(self): - self.client.login(email='adminuser@mail.com', password='wrongpass') + self.client.login(email='adminuser@example.org', password='wrongpass') response = self.client.get(reverse('idhub:admin_dashboard')) self.assertEqual(response.status_code, 302) def test_view_redirects_to_login_on_incorrect_login_attempt(self): - self.client.login(email='adminuser@mail.com', password='wrongpass') + self.client.login(email='adminuser@example.org', password='wrongpass') response = self.client.get(reverse('idhub:admin_dashboard'), follow=True) self.assertTemplateUsed(response, 'auth/login.html') def test_login_admin_user(self): - self.client.login(email='adminuser@mail.com', password='adminpass12') + self.client.login(email='adminuser@example.org', password='adminpass12') response = self.client.get(reverse('idhub:admin_dashboard')) self.assertEqual(response.status_code, 200) def test_view_uses_correct_template(self): - self.client.login(email='adminuser@mail.com', password='adminpass12') + self.client.login(email='adminuser@example.org', password='adminpass12') response = self.client.get(reverse('idhub:admin_dashboard')) self.assertTemplateUsed(response, 'idhub/admin/dashboard.html')