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

rafalp / Misago / 17497187987

05 Sep 2025 03:14PM UTC coverage: 96.509% (-0.3%) from 96.769%
17497187987

push

github

web-flow
Move `Post` model from `misago.threads` to `misago.posts` (#1995)

1884 of 1974 new or added lines in 149 files covered. (95.44%)

305 existing lines in 16 files now uncovered.

66716 of 69129 relevant lines covered (96.51%)

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", kwargs={"id": category.id, "slug": category.slug}
22
            )
23

24
        return reverse("misago:threads")
×
25

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

32
    def get_category_last_thread_new_url(self, category):
1✔
33
        return reverse(
×
34
            "misago:thread-unread-post",
35
            kwargs={"slug": category.last_thread_slug, "id": category.last_thread_id},
36
        )
37

38
    def get_category_last_post_url(self, category):
1✔
39
        return reverse(
×
40
            "misago:thread-last-post",
41
            kwargs={"slug": category.last_thread_slug, "id": category.last_thread_id},
42
        )
43

44
    def get_thread_absolute_url(self, thread, page=1):
1✔
UNCOV
45
        if page > 1:
×
46
            return reverse(
×
47
                "misago:thread",
48
                kwargs={"slug": thread.slug, "id": thread.id, "page": page},
49
            )
50

UNCOV
51
        return reverse("misago:thread", kwargs={"slug": thread.slug, "id": thread.id})
×
52

53
    def get_thread_last_post_url(self, thread):
1✔
54
        return reverse(
×
55
            "misago:thread-last-post", kwargs={"slug": thread.slug, "id": thread.pk}
56
        )
57

58
    def get_thread_new_post_url(self, thread):
1✔
59
        return reverse(
×
60
            "misago:thread-unread-post", kwargs={"slug": thread.slug, "id": thread.pk}
61
        )
62

63
    def get_thread_best_answer_url(self, thread):
1✔
64
        return reverse(
×
65
            "misago:thread-solution-post", kwargs={"slug": thread.slug, "id": thread.pk}
66
        )
67

68
    def get_thread_unapproved_post_url(self, thread):
1✔
69
        return reverse(
×
70
            "misago:thread-unapproved-post",
71
            kwargs={"slug": thread.slug, "id": thread.pk},
72
        )
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