mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-06 01:35:22 +02:00
Linting
This commit is contained in:
parent
b50f14fd3b
commit
39d51004fd
2 changed files with 6 additions and 4 deletions
|
@ -786,6 +786,7 @@ def create_staffuser():
|
|||
user.groups.set([group])
|
||||
return user
|
||||
|
||||
|
||||
def create_user():
|
||||
"""Creates a user with no special permissions"""
|
||||
User = get_user_model()
|
||||
|
@ -799,6 +800,7 @@ def create_user():
|
|||
)
|
||||
return user
|
||||
|
||||
|
||||
def create_ready_domain():
|
||||
domain, _ = Domain.objects.get_or_create(name="city.gov", state=Domain.State.READY)
|
||||
return domain
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
from unittest import skip
|
||||
from waffle.decorators import flag_is_active
|
||||
from django.test import TestCase, Client, RequestFactory
|
||||
from registrar.models import (
|
||||
|
@ -9,6 +8,7 @@ from registrar.models import (
|
|||
)
|
||||
from registrar.tests.common import create_superuser, create_staffuser, create_user
|
||||
|
||||
|
||||
class TestFeatureFlags(TestCase):
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
|
@ -32,7 +32,7 @@ class TestFeatureFlags(TestCase):
|
|||
request = self.factory.get(location)
|
||||
request.user = request_user
|
||||
self.assertTrue(flag_is_active(request, flag_name))
|
||||
|
||||
|
||||
def assert_flag_not_active(self, request_user, flag_name, location="/"):
|
||||
"""
|
||||
Checks if the given `request_user` has `flag_name` not active
|
||||
|
@ -59,7 +59,7 @@ class TestFeatureFlags(TestCase):
|
|||
|
||||
# Ensure that a normal user also can't access this flag
|
||||
self.assert_flag_not_active(request_user=self.user, flag_name=flag.name)
|
||||
|
||||
|
||||
def test_flag_active_for_is_staff(self):
|
||||
"""
|
||||
Tests flag_is_active for a flag with `is_staff = True`
|
||||
|
@ -158,4 +158,4 @@ class TestFeatureFlags(TestCase):
|
|||
self.assert_flag_not_active(request_user=self.superuser, flag_name=flag.name)
|
||||
|
||||
# Ensure that normal users cannot access this flag
|
||||
self.assert_flag_not_active(request_user=self.user, flag_name=flag.name)
|
||||
self.assert_flag_not_active(request_user=self.user, flag_name=flag.name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue