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.9.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

mock_django-0.6.9-py2-none-any.whl (12.2 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: mock-django-0.6.9.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mock-django-0.6.9.tar.gz
Algorithm Hash digest
SHA256 dcca71d48fbc47ac797d580c4d76c6a682561539b17d2b14463fab9a9be3dae7
MD5 fa2bcc482009d2f0ed5eae2d304ee095
BLAKE2b-256 d244cb14ee27913fae47fa333866709c543914de28f632bd923ecc107c67f981

See more details on using hashes here.

File details

Details for the file mock_django-0.6.9-py2-none-any.whl.

File metadata

File hashes

Hashes for mock_django-0.6.9-py2-none-any.whl
Algorithm Hash digest
SHA256 d62a4a495626e9df683a8f3dd73dbf0b0734c94572e47ceda97de5d7b346ea2a
MD5 3d688ca3a96ca363ac43ce83c1e3004d
BLAKE2b-256 ad6ad66de59a779d6c4d36f8a2b9e4fc679b6522041a8a9a39e41a5c654824da

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