Socket
Socket
Sign inDemoInstall

mock-django

Package Overview
Dependencies
0
Maintainers
2
Alerts
File Explorer

Install Socket

Protect your apps from supply chain attacks

Install

mock-django

UNKNOWN

    0.6.10

Maintainers
2

Readme

mock-django
~~~~~~~~~~~

A simple library for mocking certain Django behavior, such as the ORM.

Using mock-django objects
-------------------------
Inside your virtualenv:

.. code:: python

   >>> 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
-------

.. image:: https://secure.travis-ci.org/dcramer/mock-django.png
   :alt: Build Status
   :target: http://travis-ci.org/dcramer/mock-django

``tox``

FAQs


Did you know?

Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc