Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: supprimer les balises #noqa dans les fichiers de tests #816

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lacommunaute/forum/tests/test_categoryforum_createview.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import pytest # noqa
from django.urls import reverse

from machina.core.db.models import get_model
from pytest_django.asserts import assertContains

from lacommunaute.forum.models import Forum
from lacommunaute.users.factories import UserFactory

Expand Down
1 change: 0 additions & 1 deletion lacommunaute/forum/tests/test_categoryforum_listview.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pytest # noqa
from django.urls import reverse
from pytest_django.asserts import assertContains, assertNotContains

Expand Down
2 changes: 1 addition & 1 deletion lacommunaute/forum/tests/test_forum_rating_view.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pytest # noqa
import pytest
from django.urls import reverse

from lacommunaute.forum.factories import ForumFactory
Expand Down
2 changes: 1 addition & 1 deletion lacommunaute/forum/tests/test_forum_updateview.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from io import BytesIO

import pytest # noqa
import pytest
from django.conf import settings
from django.core.files.uploadedfile import SimpleUploadedFile
from django.urls import reverse
Expand Down
3 changes: 1 addition & 2 deletions lacommunaute/forum/tests/test_subcategoryforum_createview.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import pytest # noqa
from django.urls import reverse
from machina.core.db.models import get_model
from pytest_django.asserts import assertContains

from lacommunaute.forum.factories import CategoryForumFactory
from lacommunaute.forum.models import Forum
from lacommunaute.users.factories import UserFactory
from lacommunaute.forum.factories import CategoryForumFactory


UserForumPermission = get_model("forum_permission", "UserForumPermission")
Expand Down
2 changes: 1 addition & 1 deletion lacommunaute/forum/tests/test_subcategoryforum_listview.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pytest # noqa
import pytest
from django.urls import reverse

from lacommunaute.forum.factories import CategoryForumFactory, ForumFactory
Expand Down
3 changes: 0 additions & 3 deletions lacommunaute/forum/tests/tests_forms.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import pytest # noqa


from lacommunaute.forum.forms import ForumForm
from lacommunaute.forum.models import Forum

Expand Down
2 changes: 1 addition & 1 deletion lacommunaute/forum/tests/tests_views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re

import pytest # noqa
import pytest
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.template.defaultfilters import truncatechars_html
Expand Down
4 changes: 2 additions & 2 deletions lacommunaute/forum_conversation/tests/tests_forms.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import pytest # noqa
import pytest
from django.conf import settings
from django.forms import HiddenInput
from django.test import TestCase
from django.urls import reverse
from faker import Faker
from taggit.models import Tag

from lacommunaute.forum.factories import ForumFactory
from lacommunaute.forum_conversation.factories import (
Expand All @@ -15,7 +16,6 @@
from lacommunaute.forum_conversation.forms import PostForm
from lacommunaute.forum_conversation.models import Topic
from lacommunaute.users.factories import UserFactory
from taggit.models import Tag


faker = Faker(settings.LANGUAGE_CODE)
Expand Down
2 changes: 1 addition & 1 deletion lacommunaute/forum_conversation/tests/tests_views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pytest # noqa
import pytest
from django.conf import settings
from django.contrib.messages.api import get_messages
from django.contrib.messages.middleware import MessageMiddleware
Expand Down
8 changes: 0 additions & 8 deletions lacommunaute/forum_member/tests/tests_models.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
import pytest # noqa

from lacommunaute.forum_conversation.factories import ( # noqa
AnonymousPostFactory,
AnonymousTopicFactory,
PostFactory,
TopicFactory,
)
from lacommunaute.forum_member.factories import ForumProfileFactory
from lacommunaute.forum_member.shortcuts import get_forum_member_display_name

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import pytest # noqa

from lacommunaute.forum_conversation.factories import TopicFactory, AnonymousPostFactory
from lacommunaute.users.factories import UserFactory

from django.urls import reverse
from pytest_django.asserts import assertContains

from lacommunaute.forum_conversation.factories import AnonymousPostFactory, TopicFactory
from lacommunaute.users.factories import UserFactory


def test_detail_view_for_anonymous_post(client, db):
post = AnonymousPostFactory(topic=TopicFactory(approved=False), approved=False)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import pytest # noqa

from django.urls import reverse

from lacommunaute.forum_conversation.factories import TopicFactory, AnonymousPostFactory
from lacommunaute.forum_conversation.factories import AnonymousPostFactory, TopicFactory
from lacommunaute.forum_conversation.models import Post
from lacommunaute.forum_moderation.models import BlockedEmail, BlockedPost
from lacommunaute.users.factories import UserFactory
from lacommunaute.forum_moderation.enums import BlockedPostReason
from lacommunaute.forum_moderation.factories import BlockedEmailFactory
from lacommunaute.forum_moderation.models import BlockedEmail, BlockedPost
from lacommunaute.users.factories import UserFactory


def test_post_disapprove_view(client, db):
Expand Down
6 changes: 3 additions & 3 deletions lacommunaute/forum_moderation/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import pytest # noqa

from faker import Faker

from lacommunaute.forum_conversation.factories import AnonymousPostFactory, TopicFactory
from lacommunaute.forum_moderation.utils import check_post_approbation
from lacommunaute.forum_moderation.factories import BlockedDomainNameFactory, BlockedEmailFactory
from lacommunaute.forum_moderation.utils import check_post_approbation


faker = Faker()

Expand Down
1 change: 0 additions & 1 deletion lacommunaute/forum_upvote/tests/test_forumupvoteview.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pytest # noqa
from django.urls import reverse
from machina.core.db.models import get_model
from pytest_django.asserts import assertContains
Expand Down
1 change: 0 additions & 1 deletion lacommunaute/forum_upvote/tests/test_postupvoteview.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pytest # noqa
from django.contrib.contenttypes.models import ContentType
from django.urls import reverse
from machina.core.db.models import get_model
Expand Down
1 change: 0 additions & 1 deletion lacommunaute/forum_upvote/tests/test_upvotelistview.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pytest # noqa
from django.urls import reverse
from pytest_django.asserts import assertContains, assertTemplateUsed

Expand Down
1 change: 0 additions & 1 deletion lacommunaute/pages/tests/test_homepage.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import re

import pytest # noqa
from dateutil.relativedelta import relativedelta
from django.urls import reverse
from django.utils import timezone
Expand Down
1 change: 0 additions & 1 deletion lacommunaute/pages/tests/test_mentions_legales.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pytest # noqa
from django.urls import reverse
from pytest_django.asserts import assertTemplateUsed

Expand Down
1 change: 0 additions & 1 deletion lacommunaute/pages/tests/test_politique_confidentialite.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pytest # noqa
from django.urls import reverse
from pytest_django.asserts import assertTemplateUsed

Expand Down
2 changes: 0 additions & 2 deletions lacommunaute/partner/tests/tests_forms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import pytest # noqa

from lacommunaute.partner.forms import PartnerForm
from lacommunaute.partner.models import Partner

Expand Down
2 changes: 1 addition & 1 deletion lacommunaute/partner/tests/tests_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pytest # noqa
import pytest
from django.conf import settings
from django.db import IntegrityError

Expand Down
5 changes: 2 additions & 3 deletions lacommunaute/partner/tests/tests_partner_createview.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import pytest # noqa

import pytest
from django.urls import reverse

from lacommunaute.users.factories import UserFactory
from lacommunaute.partner.models import Partner
from lacommunaute.users.factories import UserFactory


@pytest.fixture(name="url")
Expand Down
2 changes: 1 addition & 1 deletion lacommunaute/partner/tests/tests_partner_detailview.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pytest # noqa
import pytest

from lacommunaute.forum.factories import ForumFactory
from lacommunaute.partner.factories import PartnerFactory
Expand Down
2 changes: 1 addition & 1 deletion lacommunaute/partner/tests/tests_partner_listview.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pytest # noqa
import pytest
from django.urls import reverse

from lacommunaute.partner.factories import PartnerFactory
Expand Down
3 changes: 1 addition & 2 deletions lacommunaute/partner/tests/tests_partner_updateview.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pytest # noqa

import pytest
from django.urls import reverse

from lacommunaute.partner.factories import PartnerFactory
Expand Down
7 changes: 4 additions & 3 deletions lacommunaute/stats/tests/tests_management_commands.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import pytest # noqa
from lacommunaute.stats.management.commands.collect_matomo_stats import get_initial_from_date
import pytest
from django.core.management import call_command
from lacommunaute.surveys.factories import DSPFactory

from lacommunaute.stats.factories import StatFactory
from lacommunaute.stats.management.commands.collect_matomo_stats import get_initial_from_date
from lacommunaute.surveys.factories import DSPFactory


def test_collect_django_stats(db, capsys):
Expand Down
2 changes: 1 addition & 1 deletion lacommunaute/stats/tests/tests_models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pytest # noqa
import pytest
from dateutil.relativedelta import relativedelta
from django.db import IntegrityError
from django.test import TestCase
Expand Down
2 changes: 1 addition & 1 deletion lacommunaute/stats/tests/tests_views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from datetime import date

import pytest # noqa
import pytest
from dateutil.relativedelta import relativedelta
from django.test import TestCase
from django.urls import reverse
Expand Down
5 changes: 3 additions & 2 deletions lacommunaute/surveys/tests/test_stats.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest # noqa
from datetime import datetime, date
from datetime import date, datetime

from dateutil.relativedelta import relativedelta

from lacommunaute.stats.models import Stat
from lacommunaute.surveys.factories import DSPFactory
from lacommunaute.surveys.stats import collect_dsp_stats
Expand Down
1 change: 0 additions & 1 deletion lacommunaute/surveys/tests/test_views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pytest # noqa
from django.test import override_settings
from django.urls import reverse
from pytest_django.asserts import assertContains, assertNotContains
Expand Down
Loading