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

Uploaded Source

Built Distribution

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

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for mock-django-0.6.8.tar.gz
Algorithm Hash digest
SHA256 e90ccbbc4038e463022151b9805161374b4c04d3d22636c6febdc8c2401f0c30
MD5 5134d1165ede8aed540868a926ac3b2d
BLAKE2b-256 3f285c8e70d89287a09b6acaf716cf0b1b039d8109578e9d791c84b7f54c45a5

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for mock_django-0.6.8-py2-none-any.whl
Algorithm Hash digest
SHA256 3f3f8d7039b42206254ad983cb7477440bb951828746639cb019a89ec5e0eed5
MD5 d6bac301fb3dc6282c129d50611efcdf
BLAKE2b-256 9c904a9de96b70ecd53f36ee896ae88c039fcbde8b96be46565579da52fd0fcf

See more details on using hashes here.

Provenance

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