Skip to content

Instantly share code, notes, and snippets.

@inirudebwoy
Created September 21, 2016 15:18
Show Gist options
  • Save inirudebwoy/00001dd498dd993426208a6c0f5b6f4b to your computer and use it in GitHub Desktop.
Save inirudebwoy/00001dd498dd993426208a6c0f5b6f4b to your computer and use it in GitHub Desktop.
Setup function simplifying working with a Django client.
def setUp(self):
post = partial(
self.client.post,
path='/api/task/',
content_type='application/json')
self.post = lambda data: post(data=json.dumps(data))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment