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

mozilla / fx-private-relay / b2e067fe-ce4e-4099-9bef-07b368e99782

15 Apr 2024 04:18PM CUT coverage: 75.544% (+0.002%) from 75.542%
b2e067fe-ce4e-4099-9bef-07b368e99782

push

circleci

jwhitlock
Enable pyupgrade, fix issues

2443 of 3405 branches covered (71.75%)

Branch coverage included in aggregate %.

56 of 59 new or added lines in 14 files covered. (94.92%)

234 existing lines in 24 files now uncovered.

6793 of 8821 relevant lines covered (77.01%)

20.04 hits per line

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

73.08
/api/permissions.py
1
from rest_framework import permissions
1✔
2
from waffle import flag_is_active
1✔
3

4
from emails.models import Profile
1✔
5

6
READ_METHODS = ["GET", "HEAD"]
1✔
7

8

9
class IsOwner(permissions.BasePermission):
1✔
10
    def has_object_permission(self, request, view, obj):
1✔
11
        return obj.user == request.user
1✔
12

13

14
class HasPremium(permissions.BasePermission):
1✔
15
    def has_permission(self, request, view):
1✔
UNCOV
16
        if request.method in READ_METHODS:
×
UNCOV
17
            return True
×
18
        profile = Profile.objects.get(request.user)
×
19
        return profile.has_premium
×
20

21

22
class HasPhoneService(permissions.BasePermission):
1✔
23
    def has_permission(self, request, view):
1✔
24
        if request.method in READ_METHODS:
1✔
25
            return True
1✔
26
        profile = Profile.objects.get(user=request.user)
1✔
27
        return profile.has_phone
1✔
28

29

30
class CanManageFlags(permissions.BasePermission):
1✔
31
    def has_permission(self, request, view):
1✔
UNCOV
32
        return flag_is_active(request, "manage_flags") and request.user.email.endswith(
×
33
            "@mozilla.com"
34
        )
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

© 2025 Coveralls, Inc