pytest-dev / pytest-dev/pytest-django

Create models with managed = False

Open
#264 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.5k
Forks
367
PR merge metrics
No merged PRs in 30d

Description

I have a project that works with 3rd party database, all the models for that database have managed = False in Meta because I don't want them to be created in my db.

I would still like to run some tests with fake data. So my question is: is there any way to create unmanaged models only for testing?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the question about using Django models with managed = False and fake data in tests. Determine whether pytest-django should support this workflow or whether the issue needs documentation; done means a clearly documented or implemented way to test unmanaged models.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
backend, database, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.