This repository has been archived on 2023-01-02. You can view files and clone it, but cannot push or open issues or pull requests.
django-pyvows/django_pyvows/http_helpers.py
2015-07-19 11:17:55 +02:00

22 lines
567 B
Python

#!/usr/bin/python
# -*- coding: utf-8 -*-
class HttpClientSupport(object):
def __init__(self):
self._client = None
self.ignore('get', 'post')
@property
def client(self):
if self._client is None:
from django.test.client import Client # Needs to be lazy loaded due settings config
self._client = Client()
return self._client
def get(self, *args, **kwargs):
return self.client.get(*args, **kwargs)
def post(self, *args, **kwargs):
return self.client.post(*args, **kwargs)