Move 'onmicrosoft.com' to an app constant
This commit is contained in:
@@ -134,9 +134,12 @@ def test_UserCSPPayload_mail_nickname():
|
||||
assert payload.mail_nickname == f"han.solo"
|
||||
|
||||
|
||||
def test_UserCSPPayload_user_principal_name():
|
||||
def test_UserCSPPayload_user_principal_name(app):
|
||||
payload = UserCSPPayload(**user_payload)
|
||||
assert payload.user_principal_name == f"han.solo@rebelalliance.onmicrosoft.com"
|
||||
assert (
|
||||
payload.user_principal_name
|
||||
== f"han.solo@rebelalliance.{app.config.get('OFFICE_365_DOMAIN')}"
|
||||
)
|
||||
|
||||
|
||||
def test_UserCSPPayload_password():
|
||||
@@ -167,11 +170,11 @@ class TestBillingOwnerCSPPayload:
|
||||
payload = BillingOwnerCSPPayload(**self.user_payload)
|
||||
assert payload.password
|
||||
|
||||
def test_user_principal_name(self):
|
||||
def test_user_principal_name(self, app):
|
||||
payload = BillingOwnerCSPPayload(**self.user_payload)
|
||||
assert (
|
||||
payload.user_principal_name
|
||||
== f"billing_admin@rebelalliance.onmicrosoft.com"
|
||||
== f"billing_admin@rebelalliance.{app.config.get('OFFICE_365_DOMAIN')}"
|
||||
)
|
||||
|
||||
def test_email(self):
|
||||
|
@@ -135,11 +135,11 @@ def test_create_application_job_is_idempotent(csp):
|
||||
csp.create_application.assert_not_called()
|
||||
|
||||
|
||||
def test_create_user_job(session, csp):
|
||||
def test_create_user_job(session, csp, app):
|
||||
portfolio = PortfolioFactory.create(
|
||||
csp_data={
|
||||
"tenant_id": str(uuid4()),
|
||||
"domain_name": "rebelalliance.onmicrosoft.com",
|
||||
"domain_name": f"rebelalliance.{app.config.get('OFFICE_365_DOMAIN')}",
|
||||
}
|
||||
)
|
||||
application = ApplicationFactory.create(portfolio=portfolio, cloud_id="321")
|
||||
@@ -328,7 +328,7 @@ def test_send_ppoc_email(monkeypatch, app):
|
||||
"email.portfolio_ready.body",
|
||||
{
|
||||
"password_reset_address": app.config.get("AZURE_LOGIN_URL"),
|
||||
"username": f"{user_id}@{domain_name}.onmicrosoft.com",
|
||||
"username": f"{user_id}@{domain_name}.{app.config.get('OFFICE_365_DOMAIN')}",
|
||||
},
|
||||
),
|
||||
)
|
||||
|
Reference in New Issue
Block a user