Skip to content

Support reset_sequences #308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 20 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
51bd265
Implement the reset_sequences_db fixture.
cb109 Jan 16, 2016
3cad678
Implement the reset_sequences option for the django_db mark.
cb109 Jan 16, 2016
df1bbdb
Implement tests for the reset_sequences mark option and fixture.
cb109 Jan 16, 2016
8c0dce4
Update the docs about the reset_sequences support.
cb109 Jan 16, 2016
9b7ec4b
Get the marker through the request object instead of using hardcoded …
cb109 Jan 16, 2016
e45daf3
Add missing checks for transaction support within tests.
cb109 Jan 16, 2016
50001d3
Skip reset_sequences tests for django versions that do not support it.
cb109 Jan 16, 2016
216757f
Add punctuation and fix some docstring grammar.
cb109 Jan 16, 2016
def0121
Fix db access fixture precedence.
cb109 Jan 16, 2016
c6ec611
Update docs with a note about combining db access fixtures.
cb109 Jan 16, 2016
3e3287a
Update docs about marker option usage.
cb109 Jan 17, 2016
add9d49
Do not return the TestCase instance when requesting db fixtures.
cb109 Jul 1, 2016
eaa5e7b
Rework reset_sequences_db test.
cb109 Jul 1, 2016
da378e2
Fix start id value.
cb109 Jul 1, 2016
a756f4e
Fix conflicts within docs, fixtures and plugin definition.
cb109 Jul 4, 2016
0bfb9af
Satisfy QA checks.
cb109 Jul 4, 2016
b74c28d
Remove kwargs from headline for a more readable list of contents.
cb109 Jul 4, 2016
28a3876
Fix version check against '1.10'.
cb109 Jul 14, 2016
f8d2e1d
Remove trailing whitespace.
cb109 Jul 14, 2016
fd3603a
Rename fixture to `django_db_reset_sequences`.
cb109 Jul 14, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add punctuation and fix some docstring grammar.
  • Loading branch information
cb109 committed Jan 16, 2016
commit 216757f93e7ed2a7aaba81457603e789cd239b18
8 changes: 4 additions & 4 deletions pytest_django/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def _disable_native_migrations():

@pytest.fixture(scope='function')
def db(request, _django_db_setup, _django_cursor_wrapper):
"""Require a django test database
"""Require a django test database.

This database will be setup with the default fixtures and will have
the transaction management disabled. At the end of the test the outer
Expand All @@ -190,7 +190,7 @@ def db(request, _django_db_setup, _django_cursor_wrapper):

@pytest.fixture(scope='function')
def transactional_db(request, _django_db_setup, _django_cursor_wrapper):
"""Require a django test database with transaction support
"""Require a django test database with transaction support.

This will re-initialise the django database for each test and is
thus slower than the normal ``db`` fixture.
Expand All @@ -206,10 +206,10 @@ def transactional_db(request, _django_db_setup, _django_cursor_wrapper):

@pytest.fixture(scope='function')
def reset_sequences_db(request, _django_db_setup, _django_cursor_wrapper):
"""Require a transactional test database with sequence reset support
"""Require a transactional test database with sequence reset support.

This behaves like the ``transactional_db`` fixture, with the addition
of enforcing a reset of all auto increment sequence. If the enquiring
of enforcing a reset of all auto increment sequences. If the enquiring
test relies on such values (e.g. ids as primary keys), you should
request this resource to ensure they are consistent across tests.

Expand Down