Skip to content

Commit

Permalink
Fix: tests use appname as namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun committed Dec 14, 2021
1 parent 9475ec5 commit 2ea9e9c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from django.core.management import call_command


def runtests(test_path="automations.tests"):
def runtests(test_path="automations"):
if not settings.configured:
# Choose database for settings
DATABASES = {
Expand Down Expand Up @@ -42,7 +42,7 @@ def runtests(test_path="automations.tests"):
"django.contrib.sessions",
"automations",
),
ROOT_URLCONF="automations.urls", # tests override urlconf, but it still needs to be defined
ROOT_URLCONF="automations.tests.urls", # tests override urlconf, but it still needs to be defined
LANGUAGES=(
("en", "English"),
("de", "Deutsch"),
Expand Down
4 changes: 4 additions & 0 deletions src/automations/tests/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# coding=utf-8
from django.urls import include, path

urlpatterns = [path("", include("automations.urls"))]
5 changes: 3 additions & 2 deletions src/automations/urls.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# coding=utf-8
from django.urls import path

from . import views
from . import apps, views

app_name = apps.AutomationsConfig.name

app_name = "automations"

urlpatterns = [
path("", views.TaskListView.as_view(), name="task_list"),
Expand Down
2 changes: 1 addition & 1 deletion src/automations/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def form_valid(self, form):
return super().form_valid(form)

def get_success_url(self):
return reverse("task_list")
return reverse("automations:task_list")


class TaskListView(LoginRequiredMixin, TemplateView):
Expand Down

0 comments on commit 2ea9e9c

Please sign in to comment.