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