Skip to main content

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

Release files for mock-django 0.6.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mock-django 0.6.10
File Size Uploaded
mock-django-0.6.10.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mock-django 0.6.10
File Interpreter ABI Platform
mock_django-0.6.10-py2-none-any.whl Python 2 none any Details

Total release size: 12.2 kB

Release files / mock-django-0.6.10.tar.gz

Download URL mock-django-0.6.10.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
02f052c9f9545945349f7e0c61b1626373ea291100886775413289099011d22b
BLAKE2b-256 checksum
How to use checksums
c544fcef37a4a96b8a9915a9d9745d6021ae3778d1f435707075e60a09d24347
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / mock_django-0.6.10-py2-none-any.whl

Download URL mock_django-0.6.10-py2-none-any.whl
Size 7.4 kB
Tags Python 2
SHA-256 checksum
How to use checksums
5234eb8ebcd94c004a1f4e57711c312acf5f3134f5d30239f7389b1401f13658
BLAKE2b-256 checksum
How to use checksums
a5f6706506e321185c74749bd503ae75e1a1a7dfc3aa0a164eb4df2535632af3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.6.10 This release

2 release files

0.6.9

2 release files

0.6.8

2 release files

0.6.7

2 release files

0.6.6

1 release file

0.6.5

1 release file

0.6.4

1 release file

0.6.3

1 release file

0.6.2

1 release file

0.6.1

1 release file

0.6.0

1 release file

0.5.0

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page