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

Uploaded Source

Built Distribution

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

Uploaded Python 2

File details

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

File metadata

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

File hashes

Hashes for mock-django-0.6.7.tar.gz
Algorithm Hash digest
SHA256 05fc12621a9ad3a9dca8b51f34de8d877a23e23bc1ef6ecb64ae6ad38d7c6a29
MD5 515ad742f226bf69f95dacced8d32a91
BLAKE2b-256 88e424cd4f375200a07e66ea4ed357d6be96832b6a450f2f29d85a5aa3784718

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mock_django-0.6.7-py2-none-any.whl
Algorithm Hash digest
SHA256 63285b2c44dd29f15d2918980b951a237632858ab731f3bf43b78e7992d20ca5
MD5 3bd0f36523de143190470520de1c6516
BLAKE2b-256 b8c343f004dad260fbaaa83797b6d6b2034bbe3984301659d02c5517239d993d

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