Skip to content

Commit c08fe06

Browse files
committed
pytest: optimization
1 parent 38e28fb commit c08fe06

18 files changed

+31
-28
lines changed

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ check_untyped_defs = True
8484
no_implicit_reexport = True
8585

8686
[mypy.plugins.django-stubs]
87-
django_settings_module = "tests.demo_app"
87+
django_settings_module = "tests.easy_app"
8888

8989
[mypy-*.migrations.*]
9090
# Django migrations should not produce any errors:

tests/config/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"django.contrib.sites",
1717
"django.contrib.staticfiles",
1818
"ninja_extra",
19-
"tests.demo_app",
19+
"tests.easy_app",
2020
"easy",
2121
)
2222

@@ -35,7 +35,7 @@
3535
LANGUAGE_CODE = "en-us"
3636

3737
STATIC_URL = "/static/"
38-
ROOT_URLCONF = "tests.demo_app.urls"
38+
ROOT_URLCONF = "tests.easy_app.urls"
3939

4040
AUTHENTICATION_BACKENDS = ("django.contrib.auth.backends.ModelBackend",)
4141

tests/conftest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55

66
from easy.controller.base import CrudAPIController
77
from easy.testing import EasyTestClient
8-
from tests.demo_app.auth import JWTAuthAsync, jwt_auth_async
9-
from tests.demo_app.factories import UserFactory
8+
9+
from .easy_app.auth import JWTAuthAsync, jwt_auth_async
10+
from .easy_app.factories import UserFactory
1011

1112
User = get_user_model()
1213

File renamed without changes.

tests/demo_app/apis.py renamed to tests/easy_app/apis.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from easy.main import EasyAPI
2-
from tests.demo_app.auth import jwt_auth_async
3-
from tests.demo_app.controllers import (
2+
3+
from .auth import jwt_auth_async
4+
from .controllers import (
45
AutoGenCrudAPIController,
56
EasyCrudAPIController,
67
PermissionAPIController,

tests/demo_app/apps.py renamed to tests/easy_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 TestsConfig(AppConfig):
5-
name = "tests.demo_app"
5+
name = "tests.easy_app"
File renamed without changes.

tests/demo_app/controllers.py renamed to tests/easy_app/controllers.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
IsSuperUser,
1313
)
1414
from easy.response import BaseApiResponse
15-
from tests.demo_app.models import Client, Event
16-
from tests.demo_app.schema import EventSchema
17-
from tests.demo_app.services import EventService
15+
16+
from .models import Client, Event
17+
from .schema import EventSchema
18+
from .services import EventService
1819

1920

2021
@api_controller("unittest", permissions=[BaseApiPermission])

tests/demo_app/domain.py renamed to tests/easy_app/domain.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from easy.domain import BaseDomain
2-
from tests.demo_app.models import Event
2+
3+
from .models import Event
34

45

56
class EventDomain(BaseDomain):
File renamed without changes.

0 commit comments

Comments
 (0)