Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 26, 2025
1 parent 5dd6e63 commit 1b0ed56
Show file tree
Hide file tree
Showing 32 changed files with 56 additions and 24 deletions.
1 change: 1 addition & 0 deletions tests/mitol/authentication/test_serializers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from mitol.authentication.serializers.djoser_serializers import (
CustomSendEmailResetSerializer,
)
Expand Down
1 change: 1 addition & 0 deletions tests/mitol/common/test_apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pytest
import testapp
from django.core.exceptions import ImproperlyConfigured

from mitol.common.apps import BaseApp


Expand Down
1 change: 1 addition & 0 deletions tests/mitol/common/test_decorators.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Tests for decorators"""

import pytest

from mitol.common.decorators import single_task


Expand Down
1 change: 1 addition & 0 deletions tests/mitol/common/test_envs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import pytest
from django.core.exceptions import ImproperlyConfigured

from mitol.common import envs

FAKE_ENVIRONS = {
Expand Down
5 changes: 3 additions & 2 deletions tests/mitol/common/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import pytest
import pytz
from freezegun import freeze_time
from mitol.common.factories import UserFactory
from mitol.common.utils.serializers import serialize_model_object
from testapp.models import (
AuditableTestModel,
AuditableTestModelAudit,
Expand All @@ -19,6 +17,9 @@
Updateable,
)

from mitol.common.factories import UserFactory
from mitol.common.utils.serializers import serialize_model_object

pytestmark = pytest.mark.django_db


Expand Down
1 change: 1 addition & 0 deletions tests/mitol/common/test_pytest_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json

import pytest

from mitol.common.pytest_utils import MockResponse, any_instance_of, assert_not_raises
from mitol.common.pytest_utils import test_app_json_modified as _test_app_json_modified

Expand Down
1 change: 1 addition & 0 deletions tests/mitol/common/utils/test_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from types import SimpleNamespace

import pytest

from mitol.common.utils.collections import (
all_equal,
all_unique,
Expand Down
1 change: 1 addition & 0 deletions tests/mitol/common/utils/test_currency.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from decimal import Decimal

import pytest

from mitol.common.utils.currency import format_price


Expand Down
1 change: 1 addition & 0 deletions tests/mitol/common/utils/test_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from datetime import datetime, timedelta

import pytz

from mitol.common.utils.datetime import is_near_now, now_in_utc


Expand Down
3 changes: 2 additions & 1 deletion tests/mitol/common/utils/test_http_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

import pytest
import responses
from requests.exceptions import HTTPError

from mitol.common.pytest_utils import MockResponse
from mitol.common.utils.http_requests import (
get_error_response_summary,
is_json_response,
request_get_with_timeout_retry,
)
from requests.exceptions import HTTPError


@pytest.mark.parametrize(
Expand Down
1 change: 1 addition & 0 deletions tests/mitol/common/utils/test_urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""URLs utils tests"""

import pytest

from mitol.common.utils.urls import ensure_trailing_slash, remove_password_from_url


Expand Down
3 changes: 2 additions & 1 deletion tests/mitol/digitalcredentials/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
import responses
from django.core.exceptions import ImproperlyConfigured
from django.urls import reverse
from testapp.factories import DemoCoursewareDigitalCredentialRequestFactory

from mitol.digitalcredentials.backend import (
build_api_url,
build_credential,
create_deep_link_url,
issue_credential,
verify_presentations,
)
from testapp.factories import DemoCoursewareDigitalCredentialRequestFactory


def test_build_api_url():
Expand Down
3 changes: 2 additions & 1 deletion tests/mitol/digitalcredentials/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
from hashlib import sha256

import pytest
from mitol.digitalcredentials.factories import LearnerDIDFactory
from testapp.factories import (
DemoCoursewareDigitalCredentialFactory,
DemoCoursewareDigitalCredentialRequestFactory,
)

from mitol.digitalcredentials.factories import LearnerDIDFactory

pytestmark = pytest.mark.django_db


Expand Down
3 changes: 2 additions & 1 deletion tests/mitol/digitalcredentials/test_requests_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
import hashlib

import pytest
from requests.models import PreparedRequest

from mitol.digitalcredentials.requests_utils import (
prepare_request_digest,
prepare_request_hmac_signature,
)
from requests.models import PreparedRequest

REQUEST_BODY = '{"content": 1}'
REQUEST_DIGEST = base64.b64encode(
Expand Down
9 changes: 5 additions & 4 deletions tests/mitol/digitalcredentials/test_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
import pytest
import responses
from django.contrib.contenttypes.models import ContentType
from testapp.factories import (
DemoCoursewareDigitalCredentialFactory,
DemoCoursewareDigitalCredentialRequestFactory,
)

from mitol.digitalcredentials.factories import LearnerDIDFactory
from mitol.digitalcredentials.models import (
DigitalCredential,
Expand All @@ -15,10 +20,6 @@
DigitalCredentialIssueSerializer,
DigitalCredentialRequestSerializer,
)
from testapp.factories import (
DemoCoursewareDigitalCredentialFactory,
DemoCoursewareDigitalCredentialRequestFactory,
)

pytestmark = pytest.mark.django_db

Expand Down
5 changes: 3 additions & 2 deletions tests/mitol/digitalcredentials/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
import pytest
import responses
from django.urls import reverse
from mitol.digitalcredentials.backend import create_deep_link_url
from mitol.digitalcredentials.models import DigitalCredentialRequest
from rest_framework.test import APIClient
from testapp.factories import (
DemoCoursewareDigitalCredentialRequestFactory,
DemoCoursewareFactory,
)

from mitol.digitalcredentials.backend import create_deep_link_url
from mitol.digitalcredentials.models import DigitalCredentialRequest

pytestmark = pytest.mark.django_db


Expand Down
1 change: 1 addition & 0 deletions tests/mitol/geoip/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import faker
import pytest

from mitol.geoip.api import ip_to_country_code
from mitol.geoip.factories import NetBlockIPv4Factory, NetBlockIPv6Factory

Expand Down
1 change: 1 addition & 0 deletions tests/mitol/google_sheets/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pytest
from django.core.exceptions import ImproperlyConfigured
from google.oauth2.credentials import Credentials

from mitol.google_sheets.api import get_credentials
from mitol.google_sheets.constants import REQUIRED_GOOGLE_API_SCOPES
from mitol.google_sheets.factories import GoogleApiAuthFactory
Expand Down
3 changes: 2 additions & 1 deletion tests/mitol/google_sheets/test_sheet_handler_api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import pytest
from mitol.google_sheets.sheet_handler_api import SheetHandler
from pytest_lazy_fixtures import lf as lazy_fixture

from mitol.google_sheets.sheet_handler_api import SheetHandler


@pytest.mark.usefixtures("google_sheets_base_settings")
@pytest.mark.parametrize(
Expand Down
3 changes: 2 additions & 1 deletion tests/mitol/google_sheets/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
"""Sheets app util function tests"""

from pygsheets.worksheet import Worksheet

from mitol.google_sheets.constants import (
GOOGLE_AUTH_PROVIDER_X509_CERT_URL,
GOOGLE_AUTH_URI,
GOOGLE_TOKEN_URI,
)
from mitol.google_sheets.utils import generate_google_client_config, get_data_rows
from pygsheets.worksheet import Worksheet


def test_generate_google_client_config(settings):
Expand Down
7 changes: 4 additions & 3 deletions tests/mitol/google_sheets/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
import pytest
from django.test.client import RequestFactory
from django.urls import reverse
from mitol.google_sheets.factories import GoogleApiAuthFactory
from mitol.google_sheets.models import GoogleApiAuth
from mitol.google_sheets.views import complete_google_auth
from pytest_lazy_fixtures import lf as lazy_fixture
from rest_framework import status
from testapp.utils import set_request_session

from mitol.google_sheets.factories import GoogleApiAuthFactory
from mitol.google_sheets.models import GoogleApiAuth
from mitol.google_sheets.views import complete_google_auth

lazy = lazy_fixture


Expand Down
7 changes: 4 additions & 3 deletions tests/mitol/google_sheets_deferrals/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
from types import SimpleNamespace

import pytest
from mitol.google_sheets.factories import GoogleApiAuthFactory
from mitol.google_sheets.utils import ResultType
from mitol.google_sheets_deferrals.api import DeferralRequestHandler
from pygsheets import Spreadsheet, Worksheet
from pygsheets.client import Client as PygsheetsClient
from pygsheets.drive import DriveAPIWrapper
from pygsheets.sheet import SheetAPIWrapper
from pytest_lazy_fixtures import lf as lazy_fixture

from mitol.google_sheets.factories import GoogleApiAuthFactory
from mitol.google_sheets.utils import ResultType
from mitol.google_sheets_deferrals.api import DeferralRequestHandler


@pytest.fixture()
def request_csv_rows(settings):
Expand Down
7 changes: 4 additions & 3 deletions tests/mitol/google_sheets_refunds/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
from types import SimpleNamespace

import pytest
from mitol.google_sheets.factories import GoogleApiAuthFactory
from mitol.google_sheets.utils import ResultType
from mitol.google_sheets_refunds.api import RefundRequestHandler
from pygsheets import Spreadsheet, Worksheet
from pygsheets.client import Client as PygsheetsClient
from pygsheets.drive import DriveAPIWrapper
from pygsheets.sheet import SheetAPIWrapper
from pytest_lazy_fixtures import lf as lazy_fixture

from mitol.google_sheets.factories import GoogleApiAuthFactory
from mitol.google_sheets.utils import ResultType
from mitol.google_sheets_refunds.api import RefundRequestHandler


@pytest.fixture()
def request_csv_rows(settings):
Expand Down
1 change: 1 addition & 0 deletions tests/mitol/hubspot_api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
SimplePublicObject,
SimplePublicObjectInput,
)

from mitol.common.factories import UserFactory
from mitol.hubspot_api import api
from mitol.hubspot_api.factories import HubspotObjectFactory, SimplePublicObjectFactory
Expand Down
1 change: 1 addition & 0 deletions tests/mitol/hubspot_api/test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pytest
from hubspot.crm.objects import ApiException

from mitol.hubspot_api.decorators import raise_429
from mitol.hubspot_api.exceptions import TooManyRequestsException

Expand Down
1 change: 1 addition & 0 deletions tests/mitol/mail/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pytest
from django.contrib.auth import get_user_model
from django.core.exceptions import ImproperlyConfigured

from mitol.mail.api import (
build_message,
can_email_user,
Expand Down
1 change: 1 addition & 0 deletions tests/mitol/mail/test_messages.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Message tests"""

import pytest

from mitol.mail.messages import TemplatedMessage


Expand Down
3 changes: 2 additions & 1 deletion tests/mitol/oauth_toolkit_extensions/test_backends.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"""Backends tests"""

import pytest
from mitol.oauth_toolkit_extensions.backends import ApplicationAccessOrSettingsScopes
from oauth2_provider.settings import oauth2_settings

from mitol.oauth_toolkit_extensions.backends import ApplicationAccessOrSettingsScopes


@pytest.mark.parametrize(
"application_exists, is_configured", # noqa: PT006
Expand Down
1 change: 1 addition & 0 deletions tests/mitol/oauth_toolkit_extensions/test_models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Admin interfaces"""

import pytest

from mitol.oauth_toolkit_extensions.factories import ApplicationAccessFactory

pytestmark = pytest.mark.django_db
Expand Down
1 change: 1 addition & 0 deletions tests/mitol/olposthog/test_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import pytest
from django.core.cache import caches
from freezegun import freeze_time

from mitol.common.utils.datetime import now_in_utc
from mitol.olposthog import features

Expand Down
1 change: 1 addition & 0 deletions tests/mitol/scim/test_parser.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest
from faker import Faker

from mitol.scim.parser import Filters

faker = Faker()
Expand Down
1 change: 1 addition & 0 deletions tests/mitol/scim/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from django.test import Client
from django.urls import reverse
from django_scim import constants as djs_constants

from mitol.common.factories import UserFactory
from mitol.scim import constants

Expand Down

0 comments on commit 1b0ed56

Please sign in to comment.