def test_tenant_from_request_blacklist(): request = rf(host_name="test.localhost").get("/") assert tenant_from_request( request) == settings.DATABASES["default"]["NAME"]
def test_tenant_db_from_request(): request = rf(host_name="test.testserver.com").get("/") assert tenant_from_request(request) == "test"
def test_hostname_from_request(): request = rf(host_name="test.testserver.com").get("/") assert hostname_from_request(request) == "test.testserver.com"