dimanche 20 mai 2018

Add headers in request Django 2

I'm trying to add a header to the request. Like this:

from django.test import TestCase, Client

class TestBlabla(TestCase):

    def test_just_do_it(self):
        c = Client()
        c.get(path='/some_path', **{'SOME_HEADER': some_header_data})

And it's working for me in Django < 2.0, for example in Django 1.11. But in currently 2.0.5 - i can't add a header to request. Anyone knows, what's the matter?

Aucun commentaire:

Enregistrer un commentaire