• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rafalp / Misago / 18695590791

21 Oct 2025 07:39PM UTC coverage: 96.702% (+0.2%) from 96.511%
18695590791

push

github

web-flow
Break down `misago.threads` (#1992)

8385 of 8463 new or added lines in 188 files covered. (99.08%)

6 existing lines in 2 files now uncovered.

70720 of 73132 relevant lines covered (96.7%)

0.97 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

65.63
/misago/threads/threadtypes/thread.py
1
from django.urls import reverse
1✔
2
from django.utils.translation import pgettext_lazy
1✔
3

4
from . import ThreadType
1✔
5
from ...categories import THREADS_ROOT_NAME
1✔
6

7

8
class Thread(ThreadType):
1✔
9
    root_name = THREADS_ROOT_NAME
1✔
10

11
    def get_category_name(self, category):
1✔
12
        if category.level:
1✔
13
            return category.name
1✔
14
        return pgettext_lazy(
1✔
15
            "threads root category name", "None (will become top level category)"
16
        )
17

18
    def get_category_absolute_url(self, category):
1✔
19
        if category.level:
1✔
20
            return reverse(
1✔
21
                "misago:category-thread-list",
22
                kwargs={"category_id": category.id, "slug": category.slug},
23
            )
24

NEW
25
        return reverse("misago:thread-list")
×
26

27
    def get_category_last_thread_url(self, category):
1✔
28
        return reverse(
×
29
            "misago:thread",
30
            kwargs={
31
                "thread_id": category.last_thread_id,
32
                "slug": category.last_thread_slug,
33
            },
34
        )
35

36
    def get_category_last_thread_new_url(self, category):
1✔
37
        return reverse(
×
38
            "misago:thread-post-unread",
39
            kwargs={"slug": category.last_thread_slug, "id": category.last_thread_id},
40
        )
41

42
    def get_category_last_post_url(self, category):
1✔
43
        return reverse(
×
44
            "misago:thread-post-last",
45
            kwargs={"slug": category.last_thread_slug, "id": category.last_thread_id},
46
        )
47

48
    def get_thread_absolute_url(self, thread, page=1):
1✔
49
        if page > 1:
×
50
            return reverse(
×
51
                "misago:thread",
52
                kwargs={"thread_id": thread.id, "slug": thread.slug, "page": page},
53
            )
54

NEW
55
        return reverse(
×
56
            "misago:thread", kwargs={"thread_id": thread.id, "slug": thread.slug}
57
        )
58

59
    def get_thread_last_post_url(self, thread):
1✔
60
        return reverse(
×
61
            "misago:thread-post-last",
62
            kwargs={"slug": thread.slug, "thread_id": thread.id},
63
        )
64

65
    def get_thread_new_post_url(self, thread):
1✔
66
        return reverse(
×
67
            "misago:thread-post-unread",
68
            kwargs={"slug": thread.slug, "thread_id": thread.id},
69
        )
70

71
    def get_thread_best_answer_url(self, thread):
1✔
72
        return reverse(
×
73
            "misago:thread-post-solution",
74
            kwargs={"slug": thread.slug, "thread_id": thread.id},
75
        )
76

77
    def get_thread_unapproved_post_url(self, thread):
1✔
78
        return reverse(
×
79
            "misago:thread-post-unapproved",
80
            kwargs={"slug": thread.slug, "id": thread.id},
81
        )
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc