Skip to content

Commit

Permalink
ci: auto fixes from pre-commit 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 May 22, 2024
1 parent ec4515f commit aa2505b
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ class Migration(migrations.Migration):
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='%(app_label)s_%(class)s', serialize=False, to='cms.cmsplugin'),
),
]

2 changes: 1 addition & 1 deletion tests/requirements/dj32_cms40.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Django>=3.2,<4.0

# Unreleased django 3.2 & django-cms 4.0.x compatible packages
https://github.com/django-cms/django-cms/tarball/release/4.0.1.x#egg=django-cms
https://github.com/django-cms/djangocms-versioning/tarball/1.2.2#egg=djangocms-versioning
https://github.com/django-cms/djangocms-versioning/tarball/1.2.2#egg=djangocms-versioning
7 changes: 3 additions & 4 deletions tests/test_admin.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
from importlib import reload
from unittest import skipIf

from cms import __version__ as cms_version
from cms.test_utils.testcases import CMSTestCase
from cms.utils import get_current_site
from django.contrib import admin
from django.contrib.sites.models import Site
from django.shortcuts import reverse
from django.test import RequestFactory, override_settings

from cms import __version__ as cms_version
from cms.test_utils.testcases import CMSTestCase
from cms.utils import get_current_site

try:
from djangocms_versioning.models import Version
except ImportError:
Expand Down
3 changes: 1 addition & 2 deletions tests/test_config.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from unittest import skipIf

from django.apps import apps

from cms import __version__ as cms_version
from cms.test_utils.testcases import CMSTestCase
from django.apps import apps

from djangocms_snippet.models import Snippet, SnippetGrouper

Expand Down
3 changes: 1 addition & 2 deletions tests/test_forms.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from importlib import reload
from unittest import skipIf

from django.test import override_settings

from cms import __version__ as cms_version
from cms.test_utils.testcases import CMSTestCase
from django.test import override_settings

from djangocms_snippet import forms
from djangocms_snippet.forms import SnippetPluginForm
Expand Down
3 changes: 1 addition & 2 deletions tests/test_migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
from io import StringIO
from unittest import skipIf

from cms import __version__ as cms_version
from django.core.management import call_command
from django.test import TestCase, override_settings

from cms import __version__ as cms_version


class MigrationTestCase(TestCase):

Expand Down
2 changes: 1 addition & 1 deletion tests/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from unittest import skipIf

from cms import __version__ as cms_version

from cms.api import add_plugin, create_page
from cms.test_utils.testcases import CMSTestCase

try:
from djangocms_versioning.models import Version
except ImportError:
Expand Down
3 changes: 1 addition & 2 deletions tests/test_templatetags.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from cms.test_utils.testcases import CMSTestCase
from django.core.exceptions import ObjectDoesNotExist
from django.template import Context, Template
from django.template.exceptions import TemplateSyntaxError

from cms.test_utils.testcases import CMSTestCase

from .utils.factories import SnippetPluginFactory, SnippetWithVersionFactory


Expand Down
9 changes: 3 additions & 6 deletions tests/utils/factories.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import string

import factory
from cms.models import Placeholder
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType

from cms.models import Placeholder

import factory
from django.db import models
from factory.fuzzy import FuzzyInteger, FuzzyText

from djangocms_snippet.models import Snippet, SnippetGrouper, SnippetPtr


try:
from djangocms_versioning.models import Version
except ImportError:
Expand All @@ -23,7 +20,7 @@ class UserFactory(factory.django.DjangoModelFactory):
first_name = factory.Faker("first_name")
last_name = factory.Faker("last_name")
email = factory.LazyAttribute(
lambda u: "%s.%[email protected]" % (u.first_name.lower(), u.last_name.lower())
lambda u: f"{u.first_name.lower()}.{u.last_name.lower()}@example.com"
)

class Meta:
Expand Down
4 changes: 1 addition & 3 deletions tests/utils/models.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from cms import __version__ as cms_version
from django.conf import settings
from django.db import models

from cms import __version__ as cms_version


if cms_version < "4":
class Version(models.Model):
content = models.ForeignKey("djangocms_snippet.Snippet", related_name="versions", on_delete=models.CASCADE)
Expand Down

0 comments on commit aa2505b

Please sign in to comment.