mirror of
https://github.com/Hopiu/django-notifications.git
synced 2026-03-16 21:30:24 +00:00
Fix tests
This commit is contained in:
parent
b154b0a499
commit
f33afff505
4 changed files with 22 additions and 3 deletions
10
notifications/manage.py
Normal file
10
notifications/manage.py
Normal 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)
|
||||
|
|
@ -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"),
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
9
notifications/tests/urls_for_tests.py
Normal file
9
notifications/tests/urls_for_tests.py
Normal 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")),
|
||||
]
|
||||
Loading…
Reference in a new issue