Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!


Project description

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()
>>> list(qs.all().filter())
[1, 2, 3]

See tests for more examples.


Build Status


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for mock-django, version 0.6.10
Filename, size File type Python version Upload date Hashes
Filename, size mock_django-0.6.10-py2-none-any.whl (7.4 kB) File type Wheel Python version 2.7 Upload date Hashes View
Filename, size mock-django-0.6.10.tar.gz (4.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page