tests: Add client_patch helper

(imported from commit 98486ed259a4290ca6386bdfbdf7d42080e5cc60)
This commit is contained in:
Steve Howell 2013-07-16 16:24:55 -04:00
parent 6a5cc006cd
commit 036d0b1fbc

View File

@ -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)