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

alorence / django-modern-rpc / 19383791482

10 Nov 2025 12:28PM UTC coverage: 99.018% (+0.1%) from 98.878%
19383791482

push

github

alorence
typo

178 of 179 branches covered (99.44%)

1412 of 1426 relevant lines covered (99.02%)

29.03 hits per line

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

100.0
modernrpc/compat.py
1
import sys
30✔
2
import types
30✔
3
import typing
30✔
4

5
import django
30✔
6
from django.views.decorators.csrf import csrf_exempt
30✔
7

8
if django.VERSION >= (5, 0):
30✔
9
    # Django updated its decorators to support wrapping asynchronous method in release 5.0
10
    # REF: https://docs.djangoproject.com/en/5.2/releases/5.0/#decorators
11

12
    async_csrf_exempt = csrf_exempt
15✔
13

14
else:
15
    # Fore Django version < 5.0, we partially redefine decorators to support async view
16

17
    def async_csrf_exempt(view):
15✔
18
        view.csrf_exempt = True
15✔
19
        return view
15✔
20

21

22
if sys.version_info >= (3, 14):
30✔
23

24
    def is_union_type(_type: type):
2✔
25
        return isinstance(_type, typing.Union)
2✔
26

27
elif sys.version_info >= (3, 10):
28✔
28

29
    def is_union_type(_type: type):
20✔
30
        return typing.get_origin(_type) in (types.UnionType, typing.Union)
20✔
31

32
else:
33

34
    def is_union_type(_type: type):
8✔
35
        return typing.get_origin(_type) is typing.Union
8✔
36

37

38
if sys.version_info >= (3, 14):
30✔
39

40
    def union_str_repr(obj):
2✔
41
        return str(obj)
2✔
42

43
else:
44

45
    def union_str_repr(obj: type):
28✔
46
        return " | ".join(t.__name__ for t in typing.get_args(obj))
28✔
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