Development

Get a copy of the project:

git clone https://git.m-stelzer.de/knoppo/django-model-permissions.git

cd django-model-permissions

Create a virtualenv and install the project:

python -m venv venv

. venv/bin/activate

python setup.py develop

Tests

The tox test matrix is updated regularly and runs the test-suite against sqlite, postgresql and current django versions. See tox.ini or run tox -l in the repository for the current test matrix.

pip install tox

tox

Running specific tests

  • Use the -e argument to run only one of the environments in the test matrix:

    tox -e django21-sqlite
    
  • Use the --tag argument to run only tests decorated with a specific django.test.tag():

    First, decorate a class or a test function:

    from django.test import tag
    
    class SomeTestCase(unittest.TestCase):
    
        @tag('debug')
        def test_xyz(self):
            pass
    
    @tag('debug')
    class SomeTestCase(unittest.TestCase):
    
    tox -- --tag debug
    
  • Combine the two above to run one test in one tox environment:

    tox -e django21-sqlite -- --tag debug
    

lint

tox -e flake8

Render the documentation

tox -e docs

makemigrations

To create new migrations for the app run:

tox -e makemigrations