def make_test(path, status, method='GET', data=None):
    """ Generate a test method """
    def run(self):
        response = getattr(self.client, method.lower())(path, data or {})
        self.assertEqual(response.status_code, status)
    return run
def make_test ( path , status , method = 'GET' , data = None ) : def run ( self ) : response = getattr ( self . client , method . lower ( ) ) ( path , data or { } ) self . assertEqual ( response . status_code , status ) return run
Generate a test method