GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - veatch/dumpcode: Turn django fixtures into python.

BranchesTags
Open more actions menu

Latest commit

 

History

7 Commits
7 Commits

Folders and files

NameName
Last commit message
Last commit date
management
management
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
__init__.py
__init__.py
 
 
setup.py
setup.py
 
 
tox.ini
tox.ini
 
 

Repository files navigation

dumpcode

Build Status

Fixtures slow down tests: the django test runner searches for the specified fixtures and reads them from the filesystem, and it does this for every test in the test class (search speed is improved in django 1.6). Often fixtures create objects that are not needed by tests, or are only needed for a subset of the tests. Replacing fixtures with code will decrease the runtime of your test suite and will make it easier to make further improvements to your tests.

Installation and Use

Copy dumpcode into your project and add to INSTALLED_APPS.

Run the management command: django-admin.py dumpcode fixture_name second_fixture_name The command will locate the specified fixtures the same way loaddata does and then print methods to create the objects found in them.

Paste the methods into your test file and call them from your test class's setUp method.

Next Steps

After removing fixtures, consider further improvements like deleting creation of objects that aren't needed by your tests, moving creation of objects that aren't needed by all tests into the test methods that use them, and simply instantiating objects rather than saving them to the database.

About

Turn django fixtures into python.

Resources

Readme
MIT license
Activity

Stars

5 stars

Watchers

2 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.