WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 6414b7a

Browse files
Let CI also check for missing migrations (#706)
* Refactor: re-arrange test application This was triggered by the need to run "python manage.py", which is impossible when serving the whole project in the same directory as is configured in INSTALLED_APPS ("auditlog_tests"). This setup is heavily inspired by other jazzband projects. * Add check for missing migrations
1 parent 4c1d573 commit 6414b7a

File tree

17 files changed

+55
-59
lines changed

17 files changed

+55
-59
lines changed

auditlog/models.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,9 @@ class Action:
384384
additional_data = models.JSONField(
385385
blank=True, null=True, verbose_name=_("additional data")
386386
)
387-
actor_email = models.CharField(blank=True, null=True, max_length=254)
387+
actor_email = models.CharField(
388+
blank=True, null=True, max_length=254, verbose_name=_("actor email")
389+
)
388390

389391
objects = LogEntryManager()
390392

auditlog_tests/manage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys
44

55
if __name__ == "__main__":
6-
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "auditlog_tests.test_settings")
6+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_settings")
77

88
from django.core.management import execute_from_command_line
99

auditlog_tests/apps.py renamed to auditlog_tests/test_app/apps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33

44
class AuditlogTestConfig(AppConfig):
5-
name = "auditlog_tests"
5+
name = "test_app"

auditlog_tests/fixtures/m2m_test_fixture.json renamed to auditlog_tests/test_app/fixtures/m2m_test_fixture.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[
22
{
3-
"model": "auditlog_tests.manyrelatedmodel",
3+
"model": "test_app.manyrelatedmodel",
44
"pk": 1,
55
"fields": {
66
"recursive": [1],
77
"related": [1]
88
}
99
},
1010
{
11-
"model": "auditlog_tests.manyrelatedothermodel",
11+
"model": "test_app.manyrelatedothermodel",
1212
"pk": 1,
1313
"fields": {}
1414
}
File renamed without changes.

auditlog_tests/test_app/templates/simplemodel_detail.html

Whitespace-only changes.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
from django.contrib import admin
22
from django.urls import path
33

4-
from auditlog_tests.views import SimpleModelDetailview
4+
from .views import SimpleModelDetailView
55

66
urlpatterns = [
77
path("admin/", admin.site.urls),
88
path(
99
"simplemodel/<int:pk>/",
10-
SimpleModelDetailview.as_view(),
10+
SimpleModelDetailView.as_view(),
1111
name="simplemodel-detail",
1212
),
1313
]
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
from django.views.generic import DetailView
22

33
from auditlog.mixins import LogAccessMixin
4-
from auditlog_tests.models import SimpleModel
54

5+
from .models import SimpleModel
66

7-
class SimpleModelDetailview(LogAccessMixin, DetailView):
7+
8+
class SimpleModelDetailView(LogAccessMixin, DetailView):
89
model = SimpleModel
910
template_name = "simplemodel_detail.html"

0 commit comments

Comments
 (0)