Skip to main content

UNKNOWN

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

See tests for more examples.

Testing

Build Status

tox

Project details


Download files

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

Source Distribution

mock-django-0.6.6.tar.gz (7.0 kB view details)

Uploaded Source

File details

Details for the file mock-django-0.6.6.tar.gz.

File metadata

File hashes

Hashes for mock-django-0.6.6.tar.gz
Algorithm Hash digest
SHA256 29baa9897a82ebb1d773fe7043bda2edd3ac525499b7ee8c78b69a8f66e0160a
MD5 fde7538856ffab077f6ffa08e1dd520b
BLAKE2b-256 971549a0b3b4409076967cde1141dd8cc7d490ed7b079d75514198f69055c36f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page