Skip to content

Commit

Permalink
move fixtures in forum_conversation views tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed Feb 26, 2025
1 parent a28f761 commit 7b692a6
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lacommunaute/forum_conversation/tests/tests_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@
assign_perm = get_class("forum_permission.shortcuts", "assign_perm")


@pytest.fixture(name="topics_url")
def fixture_topics_url():
return reverse("forum_conversation_extension:topics")


@pytest.fixture(name="public_forum_with_topic")
def fixture_public_forum_with_topic(db):
forum = ForumFactory(with_public_perms=True)
TopicFactory(with_post=True, forum=forum, with_tags=["tag"])
return forum


def check_email_last_seen(email):
return EmailLastSeen.objects.filter(
email=email, last_seen_kind__in=[EmailLastSeenKind.POST, EmailLastSeenKind.LOGGED]
Expand Down Expand Up @@ -822,18 +834,6 @@ def test_breadcrumbs_on_topic_view(client, db, snapshot):
assert str(content) == snapshot(name="discussion_area_topic")


@pytest.fixture(name="topics_url")
def fixture_topics_url():
return reverse("forum_conversation_extension:topics")


@pytest.fixture(name="public_forum_with_topic")
def fixture_public_forum_with_topic(db):
forum = ForumFactory(with_public_perms=True)
TopicFactory(with_post=True, forum=forum, with_tags=["tag"])
return forum


class TestTopicListView:
def test_context(self, client, topics_url, public_forum_with_topic):
response = client.get(topics_url)
Expand Down

0 comments on commit 7b692a6

Please sign in to comment.