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.6.tar.gz
(7.0 kB
view details)
File details
Details for the file mock-django-0.6.6.tar.gz
.
File metadata
- Download URL: mock-django-0.6.6.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29baa9897a82ebb1d773fe7043bda2edd3ac525499b7ee8c78b69a8f66e0160a |
|
MD5 | fde7538856ffab077f6ffa08e1dd520b |
|
BLAKE2b-256 | 971549a0b3b4409076967cde1141dd8cc7d490ed7b079d75514198f69055c36f |