From 5475f07d9bd43c90c1e1c79907eaef2a65561203 Mon Sep 17 00:00:00 2001 From: David Kennedy Date: Fri, 20 Sep 2024 16:35:23 -0400 Subject: [PATCH] fixed unit test and linting --- src/registrar/tests/test_utilities.py | 5 +++-- src/registrar/utility/waffle.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/registrar/tests/test_utilities.py b/src/registrar/tests/test_utilities.py index b615ae71c..5a2234d66 100644 --- a/src/registrar/tests/test_utilities.py +++ b/src/registrar/tests/test_utilities.py @@ -1,13 +1,14 @@ from django.test import TestCase -from django.contrib.auth.models import User +from registrar.models import User from waffle.testutils import override_flag from registrar.utility.waffle import flag_is_active_for_user + class FlagIsActiveForUserTest(TestCase): def setUp(self): # Set up a test user - self.user = User.objects.create_user(username="testuser", password="testpassword") + self.user = User.objects.create_user(username="testuser") @override_flag("test_flag", active=True) def test_flag_active_for_user(self): diff --git a/src/registrar/utility/waffle.py b/src/registrar/utility/waffle.py index 16ec03f0d..a78799e4c 100644 --- a/src/registrar/utility/waffle.py +++ b/src/registrar/utility/waffle.py @@ -1,6 +1,7 @@ from django.http import HttpRequest from waffle.decorators import flag_is_active + def flag_is_active_for_user(user, flag_name): """flag_is_active_for_user can be used when a waffle_flag may be activated for a user, but the context of where the flag needs to @@ -8,4 +9,4 @@ def flag_is_active_for_user(user, flag_name): When the request is available, flag_is_active should be used.""" request = HttpRequest() request.user = user - return flag_is_active(request, flag_name) \ No newline at end of file + return flag_is_active(request, flag_name)