Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Internet > HTTP (WWW)

    django-pytest 0.1.4

    Download button

    No screenshots available
    Downloads: 286  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Dusty Phillips | More programs
    BSD License / FREE
    August 23rd, 2010, 10:24 GMT
    ROOT / Internet / HTTP (WWW)

     Read user reviews (0)  Refer to a friend  Subscribe

    django-pytest description

    Django test runner to use py.test tests

    django-pytest is a project that allows you to use py.test as a Django test runner, instead of the default test runner.

    To use it, add it to your python path and add *django_pytest* to your installed apps. Also set the *TEST_RUNNER = 'django_pytest.test_runner.run_tests'* setting.

    Also create a conftest.py in your project directory and include:

    from django_pytest.conftest import pytest_funcarg__client, pytest_funcarg__django_client


    You can also use

    from django_pytest.auth_funcargs import pytest_funcarg__user, pytest_funcarg__groups

    to import a user or some groups with users in them

    Now anywhere in your project, you can create files called *test_< something >.py*.  These are standard py.test test files. Use the funcarg *client* in every test to both instantiate a test database that is cleared after each test and to provide you with a django test client object identical to the one used in django's test system. For example:

    def test_filter(client):
        response = client.get('/browse/', {'filter': '1'})
        assert response.status_code == 200


    Use *./manage.py test* to run the py.test test runs (ie: it replaces the standard django test runner). You can pass py.test options to the command and they will be forwarded to py.test. (Technically, I haven't got it passing all options, just the most common ones I use).

    The management command has been set up so that syncdb will use the django core syncdb, even if south is installed. This prevents migrations from running when running unit tests.

    This project differs from http://github.com/bfirsh/pytest_django in that it provides a django test runner that calls py.test, rather than creating a py.test plugin to test django projects. I believe there is overlapping functionality from the two projects, and also that they can be integrated into a single project, but I have not looked at the feasibility of this yet.


    Product's homepage

    Requirements:

    · Python
    · Django

      


    TAGS:

    test runner | py.test tests | Django | tests | runner

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM