Created
March 29, 2018 12:54
-
-
Save afbio/70a9dc306bdfd76daf6fe93d89fca67d to your computer and use it in GitHub Desktop.
Reset database sequence among tests on same module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Postgre tested | |
@pytest.fixture(autouse=True) | |
def reset_sequence(): | |
cur = connection.cursor() | |
cur.execute('ALTER SEQUENCE table_name RESTART WITH 1;') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment