Opened 15 years ago

Closed 10 years ago

#11029 closed New feature (needsinfo)

Model mocking support

Reported by: Almad Owned by: nobody
Component: Testing framework Version: 1.1-beta
Severity: Normal Keywords:
Cc: django@… Triage Stage: Someday/Maybe
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Writing unit tests is hard mainly because of how tight are Models coupled to database. Being able to mock Models in a way that one could run tests entirely in memory (giving far better performance then even in-memory sqlite as one must not handle rollbacks and stuff) would be really helpful.

Main problem to solve are foreign keys and contenttype framework handling. Solution could probably be some kind of mocking backend that do not support any database operations except for creation (and providing ID from in-memory generator) and primary-key retrieval (from stored dictionary).

Change History (8)

comment:1 by Almad, 15 years ago

I know this is low priority and someday/maybe request, but I was ask to store the idea during EDC sprints.

comment:2 by Alex Gaynor, 15 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Julien Phalip, 13 years ago

Severity: Normal
Type: New feature

comment:4 by Aymeric Augustin, 12 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:5 by Aymeric Augustin, 12 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:6 by John Krukoff, 12 years ago

Cc: django@… added

comment:7 by Aymeric Augustin, 11 years ago

Triage Stage: AcceptedSomeday/Maybe

comment:8 by Aymeric Augustin, 10 years ago

Resolution: needsinfo
Status: newclosed

This idea has been floating around for years. I'm not convinced it's useful to keep an open ticket without a concrete proposal.

Note: See TracTickets for help on using tickets.
Back to Top