From 036d0b1fbc2fa5faf125e53c9bc9cf0d721973fb Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Tue, 16 Jul 2013 16:24:55 -0400 Subject: [PATCH] tests: Add client_patch helper (imported from commit 98486ed259a4290ca6386bdfbdf7d42080e5cc60) --- zephyr/tests.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zephyr/tests.py b/zephyr/tests.py index aed7e648d3..622026a698 100644 --- a/zephyr/tests.py +++ b/zephyr/tests.py @@ -27,6 +27,7 @@ import re import sys import time import ujson +import urllib import urllib2 from StringIO import StringIO @@ -99,6 +100,12 @@ def is_known_slow_test(test_method): API_KEYS = {} class AuthedTestCase(TestCase): + def client_patch(self, url, info): + # self.client.patch will be available in later versions of Django, + # although we may still want our version for the url encoding + info = urllib.urlencode(info) + return self.client.generic('PATCH', url, info) + def login(self, email, password=None): if password is None: password = initial_password(email)