I write tests for a Django application and use the attribute on my test class to save which view it should test, for example:
class OrderTests(TestCase, ShopTest):
_VIEW = views.order
def test_gateway_answer(self):
url = 'whatever url'
request = self.request_factory(url, 'GET')
self._VIEW(request, **{'sku': order.sku})
def order(request, sku)
...
I am assuming that the problem I am having is caused by the fact that since I am calling the class attribute OrderTests, python assumes that I want to send selfand then orderreceive the wrong arguments. It's easy to decide ... just don't use it as an attribute of a class, but I was wondering if there is a way to tell python not to send itself in this case.
Thank.
source
share