Fix tests

This commit is contained in:
Alvaro Mariano 2023-07-06 20:54:22 +00:00
parent b154b0a499
commit f33afff505
4 changed files with 22 additions and 3 deletions

10
notifications/manage.py Normal file
View file

@ -0,0 +1,10 @@
#!/usr/bin/env python
""" Django notification manage file """
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "notification.tests.settings_for_tests")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)

View file

@ -30,7 +30,7 @@ INSTALLED_APPS = [
"notifications",
]
ROOT_URLCONF = "notifications.urls"
ROOT_URLCONF = "notifications.tests.urls_for_tests"
STATIC_URL = "/static/"
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),

View file

@ -201,7 +201,7 @@ class NotificationTestPages(TestCase):
def login(self, username, password):
self.logout()
response = self.client.post(reverse("login"), {"username": username, "password": password})
response = self.client.post(reverse("admin:login"), {"username": username, "password": password})
self.assertEqual(response.status_code, 302)
return response
@ -504,7 +504,7 @@ class NotificationTestExtraData(TestCase):
def login(self, username, password):
self.logout()
response = self.client.post(reverse("login"), {"username": username, "password": password})
response = self.client.post(reverse("admin:login"), {"username": username, "password": password})
self.assertEqual(response.status_code, 302)
return response

View file

@ -0,0 +1,9 @@
""" Django notification urls for tests """
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path("admin/", admin.site.urls),
path("", include("notifications.urls", namespace="notifications")),
]