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
tox
Project details
Release history Release notifications | RSS feed
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.10.tar.gz
(4.8 kB
view details)
Built Distribution
File details
Details for the file mock-django-0.6.10.tar.gz
.
File metadata
- Download URL: mock-django-0.6.10.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02f052c9f9545945349f7e0c61b1626373ea291100886775413289099011d22b |
|
MD5 | 0f8dae8060a7a3eda42a79711edff0bd |
|
BLAKE2b-256 | c544fcef37a4a96b8a9915a9d9745d6021ae3778d1f435707075e60a09d24347 |
File details
Details for the file mock_django-0.6.10-py2-none-any.whl
.
File metadata
- Download URL: mock_django-0.6.10-py2-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5234eb8ebcd94c004a1f4e57711c312acf5f3134f5d30239f7389b1401f13658 |
|
MD5 | 2ada45c343a53e3375fcf90a68abe271 |
|
BLAKE2b-256 | a5f6706506e321185c74749bd503ae75e1a1a7dfc3aa0a164eb4df2535632af3 |