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:42:54 +02:00

28 lines
765 B
Python

# -*- coding: utf-8 -*-
# django-pyvows extensions
# https://github.com/rafaelcaricio/django-pyvows
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 Rafael Caricio rafael@caricio.com
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)