Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Move api account tests

fowczrekbd4dbb768a93
diff --git a/conftest.py b/conftest.py
index 262b94e4bf..fcf8641ba4 100644
--- a/conftest.py
+++ b/conftest.py
@@ -1 +1,5 @@
-pytest_plugins = ["tests.fixtures", "saleor.plugins.tests.fixtures"]
+pytest_plugins = [
+ "tests.fixtures",
+ "saleor.plugins.tests.fixtures",
+ "tests.api.fixtures",
+]
diff --git a/saleor/graphql/account/tests/__init__.py b/saleor/graphql/account/tests/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/api/test_account.py b/saleor/graphql/account/tests/test_account.py
similarity index 99%
rename from tests/api/test_account.py
rename to saleor/graphql/account/tests/test_account.py
index 09c79f8b7d..722cb4e3f8 100644
--- a/tests/api/test_account.py
+++ b/saleor/graphql/account/tests/test_account.py
@@ -31,14 +31,13 @@ from saleor.graphql.account.mutations.staff import (
)
from saleor.graphql.core.utils import str_to_enum
from saleor.order.models import FulfillmentStatus, Order
-from tests.api.utils import get_graphql_content
-from tests.utils import create_image
-
-from .utils import (
+from tests.api.utils import (
assert_no_permission,
convert_dict_keys_to_camel_case,
+ get_graphql_content,
get_multipart_request_body,
)
+from tests.utils import create_image
@pytest.fixture
diff --git a/tests/api/test_account_depreceated_service_account.py b/saleor/graphql/account/tests/test_account_depreceated_service_account.py
similarity index 99%
rename from tests/api/test_account_depreceated_service_account.py
rename to saleor/graphql/account/tests/test_account_depreceated_service_account.py
index 694804e39d..640416c203 100644
--- a/tests/api/test_account_depreceated_service_account.py
+++ b/saleor/graphql/account/tests/test_account_depreceated_service_account.py
@@ -6,8 +6,7 @@ from freezegun import freeze_time
from saleor.account.error_codes import AccountErrorCode
from saleor.app.models import App, AppToken
from saleor.graphql.core.enums import PermissionEnum
-
-from .utils import assert_no_permission, get_graphql_content
+from tests.api.utils import assert_no_permission, get_graphql_content
@pytest.fixture
diff --git a/tests/api/test_account_events.py b/saleor/graphql/account/tests/test_account_events.py
similarity index 99%
rename from tests/api/test_account_events.py
rename to saleor/graphql/account/tests/test_account_events.py
index 405f47b30b..9d5a68ca47 100644
--- a/tests/api/test_account_events.py
+++ b/saleor/graphql/account/tests/test_account_events.py
@@ -3,8 +3,7 @@ from django.db import models
from saleor.account import events as account_events
from saleor.account.models import User
-
-from .utils import get_graphql_content
+from tests.api.utils import get_graphql_content
QUERY_CUSTOMER_EVENTS = """
query customerEvents($customerId: ID!) {
diff --git a/tests/api/test_account_meta.py b/saleor/graphql/account/tests/test_account_meta.py
similarity index 100%
rename from tests/api/test_account_meta.py
rename to saleor/graphql/account/tests/test_account_meta.py
diff --git a/tests/api/test_account_permission_group.py b/saleor/graphql/account/tests/test_account_permission_group.py
similarity index 99%
rename from tests/api/test_account_permission_group.py
rename to saleor/graphql/account/tests/test_account_permission_group.py
index c0477447d8..734506057a 100644
--- a/tests/api/test_account_permission_group.py
+++ b/saleor/graphql/account/tests/test_account_permission_group.py
@@ -5,8 +5,7 @@ from django.contrib.auth.models import Group
from saleor.account.error_codes import PermissionGroupErrorCode
from saleor.account.models import User
from saleor.core.permissions import AccountPermissions, AppPermission, OrderPermissions
-
-from .utils import assert_no_permission, get_graphql_content
+from tests.api.utils import assert_no_permission, get_graphql_content
PERMISSION_GROUP_CREATE_MUTATION = """
mutation PermissionGroupCreate(
diff --git a/tests/api/test_account_utils.py b/saleor/graphql/account/tests/test_account_utils.py
similarity index 100%
rename from tests/api/test_account_utils.py
rename to saleor/graphql/account/tests/test_account_utils.py
diff --git a/tests/api/conftest.py b/tests/api/fixtures.py
similarity index 100%
rename from tests/api/conftest.py
rename to tests/api/fixtures.py
diff --git a/tests/api/test_view.py b/tests/api/test_view.py
index 40da294e46..98ef270d19 100644
--- a/tests/api/test_view.py
+++ b/tests/api/test_view.py
@@ -7,7 +7,7 @@ from django.test import override_settings
from saleor.demo.views import EXAMPLE_QUERY
from saleor.graphql.product.types import Product
-from .conftest import API_PATH
+from .fixtures import API_PATH
from .utils import _get_graphql_content_from_response, get_graphql_content