You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

mock-django

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mock-django

UNKNOWN


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

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc