No description, website, or topics provided.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
mock_django
tests Hides MergeDict except when needed Jul 29, 2015
.gitignore Added tox as test runner Jun 17, 2013
.travis.yml Add Django 1.9 testing support Oct 2, 2015
LICENSE License Feb 6, 2012
README.rst
runtests.py Add Django 1.9 testing support Oct 2, 2015
setup.py
tox.ini

README.rst

mock-django

A simple library for mocking certain Django behavior, such as the ORM.

Using mock-django objects

Inside your virtualenv:

>>> from django.conf import settings
>>> settings.configure() # required to convince Django it's properly configured
>>> from mock_django.query import QuerySetMock
>>> class Post(object): pass
...
>>> qs = QuerySetMock(Post, 1, 2, 3)
>>> list(qs.all())
[1, 2, 3]
>>> qs.count()
3
>>> list(qs.all().filter())
[1, 2, 3]

See tests for more examples.

Testing

Build Status

tox