Skip to content

Commit

Permalink
chore: override setting directly in the test
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanttV committed Aug 21, 2024
1 parent 64d0f7e commit 09781d7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions eox_core/tests/tutor/integration_test_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,7 @@ def create_tenant(name: str, host: str) -> str:
return domain


@override_settings(
ALLOWED_HOSTS=["testserver"],
SITE_ID=2,
EOX_CORE_USERS_BACKEND="eox_core.edxapp_wrapper.backends.users_m_v1",
)
@override_settings(ALLOWED_HOSTS=["testserver"], SITE_ID=2)
class TestUsersAPIIntegration(TestCase):
"""Integration test suite for the Users API"""

Expand Down Expand Up @@ -104,6 +100,7 @@ def get_access_token(self, tenant_domain: str) -> str:
response_access_token = self.client.post(access_token_endpoint, data=access_token_data)
return response_access_token.json()["access_token"]

@override_settings(EOX_CORE_USERS_BACKEND="eox_core.edxapp_wrapper.backends.users_m_v1")
def test_create_user_in_tenant(self):
"""Test the creation of a user in a tenant."""
path = f"http://{self.tenant_x_domain}/eox-core/api/v1/user/"
Expand All @@ -114,8 +111,9 @@ def test_create_user_in_tenant(self):
"password": "p@$$w0rd",
"activate_user": True,
}
headers = {"Authorization": f"Bearer {self.tenant_x_token}"}
print(f"\n\nHeaders: {headers}\n\n")
authorization_bearer = f"Bearer {self.tenant_x_token}"
print(f"\n\nAuthorization bearer: {authorization_bearer}\n\n")
headers = {"Authorization": authorization_bearer}

response = self.client.post(path, data=data, headers=headers)

Expand Down

0 comments on commit 09781d7

Please sign in to comment.