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
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)
| File | Size | Uploaded | |
|---|---|---|---|
| mock-django-0.6.10.tar.gz | 4.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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 |