Skip to content

Instantly share code, notes, and snippets.

@erdimeola
Created January 6, 2014 09:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erdimeola/8280439 to your computer and use it in GitHub Desktop.
Save erdimeola/8280439 to your computer and use it in GitHub Desktop.
Django unit test set http headers
class MyTest(TestCase):
def setUp(self):
self.request_headers = { 'HTTP_HOST': 'subdomain.domain.com' }
def test_header(self):
client = Client()
client.get('path', **self.request_headers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment