mardi 19 juin 2018

How do I add a Query String in djangos post TestCase?

I want to add a querystring in a Django APITestCase of a post function. This is the Code that I use to test post functions without a query string:

self.url_pks = dict(cs_pk=self.cs,
                    kf_pk=self.kf)
url = 'as-list'
self.post_data = dict(model_feature='test')
response = self.post(url, **self.url_pks, data=self.post_data,
                         extra={'format': 'json'})

The URL that I would like to test is: /api/cs/7/kf/30/as/?GET=true
So how can I include the '?GET=true'-part?

Aucun commentaire:

Enregistrer un commentaire