From 19a6254e1362c5ddf31fa4ab7f66bb8b4bc4c68d Mon Sep 17 00:00:00 2001 From: Rachid Mrad Date: Wed, 18 Sep 2024 15:05:55 -0400 Subject: [PATCH] test for regular user --- src/registrar/tests/test_api.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/registrar/tests/test_api.py b/src/registrar/tests/test_api.py index 56b54dbba..ef5385d72 100644 --- a/src/registrar/tests/test_api.py +++ b/src/registrar/tests/test_api.py @@ -163,3 +163,17 @@ class GetActionNeededEmailForUserJsonTest(TestCase): data = response.json() self.assertIn("action_needed_email", data) self.assertIn("SENIOR OFFICIAL DOES NOT MEET ELIGIBILITY REQUIREMENTS", data["action_needed_email"]) + + @less_console_noise_decorator + def test_get_action_needed_email_for_user_json_regular(self): + """Test that a regular user receives a 403 with an error message.""" + p = "password" + self.client.login(username="testuser", password=p) + response = self.client.get( + self.api_url, + { + "reason": DomainRequest.ActionNeededReasons.QUESTIONABLE_SENIOR_OFFICIAL, + "domain_request_id": self.domain_request.id, + }, + ) + self.assertEqual(response.status_code, 302)