Skip to content

Cann't override the Host header from the ApiClient while testing #9711

Closed
@golesuman

Description

@golesuman

I am writing a test to override the HTTP_HOST header from the api client while testing, but I couldn't figure out a way to do it. I checked the code from here and I don't think headers was passed (checked this piece of code from django) to RequestFactory or is there any other way to do it ?

I am currently doing something like this, but looking at the code it seems this is passed as extra

 domain = store.domain
 response = api_client.get(url, **{"Host" : domain})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions