File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,17 +45,44 @@ graphql_api = [
4545 " graphql-core<3,>=2.1" ,
4646 " graphql-relay<3,>=2" ,
4747]
48+ test = [
49+ " pytest" ,
50+ " pytest-django" ,
51+ " pytest-cov" ,
52+ ]
53+ all = [" django-ilmoitin[test,graphql_api]" ]
4854
4955[project .urls ]
5056Homepage = " https://github.com/City-of-Helsinki/django-ilmoitin"
5157
52- [tool .hatch .build .targets .wheel ]
53- packages = [" django_ilmoitin" ]
54-
5558[tool .coverage .run ]
5659source = [" django_ilmoitin" ]
5760omit = [" **/migrations/*" , " **/tests/*" ]
5861
62+ [tool .hatch .build .targets .wheel ]
63+ packages = [" django_ilmoitin" ]
64+
65+ [tool .hatch .envs .default ]
66+ dependencies = [
67+ " django~=5.2" ,
68+ " pre-commit" ,
69+ ]
70+ features = [" all" ]
71+ python = " 3.10"
72+
73+ [tool .hatch .envs .default .scripts ]
74+ test = " pytest {args}"
75+ lint = [
76+ " pre-commit install" ,
77+ " pre-commit run -a" ,
78+ ]
79+ manage = " tests/manage.py {args}"
80+
81+ [tool .hatch .envs .hatch-uv ]
82+ dependencies = [
83+ " uv==0.11.2" ,
84+ ]
85+
5986[tool .pytest .ini_options ]
6087testpaths = [
6188 " tests" ,
@@ -96,3 +123,6 @@ select = [
96123 # flake8-print
97124 " T20" ,
98125]
126+
127+ [tool .uv ]
128+ exclude-newer = " 14 days"
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+ """Django's command-line utility for administrative tasks."""
3+
4+ import os
5+ import sys
6+
7+
8+ def main ():
9+ """Run administrative tasks."""
10+ os .environ .setdefault ("DJANGO_SETTINGS_MODULE" , "tests.settings" )
11+ try :
12+ from django .core .management import execute_from_command_line
13+ except ImportError as exc :
14+ raise ImportError (
15+ "Couldn't import Django. Are you sure it's installed and "
16+ "available on your PYTHONPATH environment variable? Did you "
17+ "forget to activate a virtual environment?"
18+ ) from exc
19+ execute_from_command_line (sys .argv )
20+
21+
22+ if __name__ == "__main__" :
23+ main ()
Original file line number Diff line number Diff line change 1- DATABASES = {"default" : {"ENGINE" : "django.db.backends.sqlite3" , "NAME" : ":memory: " }}
1+ DATABASES = {"default" : {"ENGINE" : "django.db.backends.sqlite3" , "NAME" : "db.sqlite3 " }}
22
33INSTALLED_APPS = (
44 "django.contrib.contenttypes" ,
2020 "django.contrib.messages.middleware.MessageMiddleware" ,
2121]
2222
23+ TEMPLATES = [
24+ {
25+ "BACKEND" : "django.template.backends.django.DjangoTemplates" ,
26+ "DIRS" : [],
27+ "APP_DIRS" : True ,
28+ "OPTIONS" : {
29+ "context_processors" : [
30+ "django.template.context_processors.debug" ,
31+ "django.template.context_processors.request" ,
32+ "django.contrib.auth.context_processors.auth" ,
33+ "django.contrib.messages.context_processors.messages" ,
34+ ],
35+ },
36+ },
37+ ]
38+
2339SITE_ID = 1
2440ROOT_URLCONF = "tests.urls"
2541DEBUG = True
You can’t perform that action at this time.
0 commit comments