Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support subdomains #11

Open
JupiterThreads opened this issue Apr 12, 2022 · 0 comments
Open

Support subdomains #11

JupiterThreads opened this issue Apr 12, 2022 · 0 comments

Comments

@JupiterThreads
Copy link

JupiterThreads commented Apr 12, 2022

Great library!

I was wondering if anyone could assist me. I'm trying to use this library with a different subdomain. I'm aware I should override the client fixture to change the host, but that doesn't seem to be working as none of my urls are being recognised. I'm not sure if its to do with the tenant migrations. Here is the fixture, I'm using:

@pytest.fixture
def create_drf_client():
    from pytest_drf.client import DRFTestClient

    def create_drf_client(user: 'User') -> 'DRFTestClient':
        client = DRFTestClient(HTTP_HOST='mysubdomain.testserver')
        client.force_authenticate(user=user)
        return client

    return create_drf_client

Might be more of an issue with the tenant library I'm using and the order in which tests are being run. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant