Skip to content

Commit 9fbda99

Browse files
Further organize projet test files after recent changes
1 parent 4a6c110 commit 9fbda99

File tree

8 files changed

+62
-71
lines changed

8 files changed

+62
-71
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
"""
2+
URL configuration for django-expanded-test-cases project UnitTests.
3+
4+
Mocks being an "app" urls.py file.
5+
"""
6+
7+
# Third-Party Imports.
8+
from django.urls import path
9+
10+
# Internal Imports.
11+
from tests.django_expanded_test_cases.testing import views
12+
13+
14+
app_name = 'django_expanded_test_cases'
15+
urlpatterns = [
16+
# Simple test views.
17+
path('home/', views.home, name='home'),
18+
path('home-no-slash', views.home, name='home-no-trailing-slash'),
19+
path('login/', views.login, name='login'),
20+
path('views/one-message/', views.view_with_one_message, name='response-with-one-message'),
21+
path('views/two-messages/', views.view_with_two_messages, name='response-with-two-messages'),
22+
path('views/three-messages/', views.view_with_three_messages, name='response-with-three-messages'),
23+
path('views/repeating-elements/', views.view_with_repeating_elements, name='response-with-repeating-elements'),
24+
path('views/<int:id>/<str:name>/', views.view_with_args, name='response-with-args'),
25+
# Template response views.
26+
path('template-response/home/', views.template_response_home, name='template-response-home'),
27+
path(
28+
'template-response/messages/',
29+
views.template_response_with_three_messages,
30+
name='template-response-messages',
31+
),
32+
path(
33+
'template-response/<int:id>/<str:name>/',
34+
views.template_response_with_args,
35+
name='template-response-with-args',
36+
),
37+
# Json response views.
38+
path('json/index/', views.json_response_index, name='json-response-index'),
39+
# Model test views.
40+
path('user/detail/<int:pk>/', views.user_detail, name='user-detail'),
41+
# Redirect views.
42+
path('redirect/index/', views.redirect_to_index, name='redirect-to-index'),
43+
path('redirect/with_args/<int:id>/<str:name>/', views.redirect_with_args, name='redirect-with-args'),
44+
# Form views.
45+
path('forms/basic-form/', views.view_with_basic_form, name='response-with-basic-form'),
46+
path('forms/basic-formset/', views.view_with_basic_formset, name='response-with-basic-formset'),
47+
path('forms/alt-form/', views.view_with_alt_form_name, name='response-with-alt-form-name'),
48+
path('forms/alt-formset/', views.view_with_alt_formset_name, name='response-with-alt-formset-name'),
49+
# Index view.
50+
path('', views.index, name='index'),
51+
]

tests/django_expanded_test_cases/testing/test_forms.py renamed to tests/django_expanded_test_cases/testing/forms.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
"""
2-
Testing forms for django-expanded-test-cases project.
2+
Forms for django-expanded-test-cases project UnitTests.
33
"""
44

55
# Third-Party Imports.
66
from django import forms
7-
from django.forms import BaseFormSet, formset_factory
7+
from django.forms import formset_factory
88

99

1010
class BasicForm(forms.Form):
11-
""""""
11+
"""A base form with trivial fields, to test basic pack logic when handling forms."""
1212

1313
required_charfield = forms.CharField(label='CharField - Required', required=True, max_length=100)
1414
optional_charfield = forms.CharField(label='CharField - Optional', required=False, max_length=100)

tests/django_expanded_test_cases/testing/test_urls.py

Lines changed: 0 additions & 50 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Testing URL configuration for django-expanded-test-cases project.
2+
Root URL configuration for django-expanded-test-cases project UnitTests.
33
44
Mocks being the "project settings root" urls.py file.
55
"""
@@ -9,5 +9,5 @@
99

1010

1111
urlpatterns = [
12-
path('', (include('tests.django_expanded_test_cases.testing.test_urls', namespace='django_expanded_test_cases'))),
12+
path('', (include('tests.django_expanded_test_cases.testing.app_urls', namespace='django_expanded_test_cases'))),
1313
]

tests/django_expanded_test_cases/testing/test_views.py renamed to tests/django_expanded_test_cases/testing/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Testing views for django-expanded-test-cases project.
2+
Views for django-expanded-test-cases project UnitTests.
33
"""
44

55
# Third-Party Imports.
@@ -11,7 +11,7 @@
1111
from django.urls import reverse
1212

1313
# Internal Imports.
14-
from tests.django_expanded_test_cases.testing.test_forms import BasicForm, BasicFormset
14+
from tests.django_expanded_test_cases.testing.forms import BasicForm, BasicFormset
1515

1616

1717
def index(request):

tests/django_expanded_test_cases/tests/test_base_case/test_base_auth.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from unittest.mock import patch
77

88
# Internal Imports.
9-
from .test_base_case import BaseTestMixin
109
from django_expanded_test_cases import BaseTestCase
1110

1211

tests/django_expanded_test_cases/tests/test_integration_case/test_integration_auth.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,13 @@
88

99
# Third-Party Imports.
1010
from django.contrib.auth import get_user_model
11-
from django.contrib.auth.models import AnonymousUser, Group, Permission
12-
from django.contrib.contenttypes.models import ContentType
11+
from django.contrib.auth.models import AnonymousUser
1312
from django.core.exceptions import ValidationError
14-
from django.http import HttpResponse
15-
from django.test import override_settings
16-
from django.urls import reverse
1713

1814
# Internal Imports.
1915
from .test_integration_assertions import IntegrationAssertionTestCase
2016
from .test_integration_helpers import IntegrationHelperTestCase
2117
from django_expanded_test_cases import IntegrationTestCase
22-
from django_expanded_test_cases.constants import (
23-
COLORAMA_PRESENT,
24-
ETC_OUTPUT_ACTUALS_MATCH_COLOR,
25-
ETC_OUTPUT_ERROR_COLOR,
26-
ETC_OUTPUT_EXPECTED_MATCH_COLOR,
27-
ETC_OUTPUT_RESET_COLOR,
28-
)
2918

3019

3120
class IntegrationAuthTestCase(IntegrationAssertionTestCase, IntegrationHelperTestCase):

tests/django_expanded_test_cases/tests/test_live_server_case/universal_live_test_mixin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
"""Mixin class for all tests which apply to all LiveServerTestCase classes."""
1+
"""
2+
Mixin class for all tests which apply to all LiveServerTestCase classes.
3+
"""
24

35
# System Imports.
46
import logging

0 commit comments

Comments
 (0)