Skip to content

Cannot specify reset_sequences on a transactional test #299

Closed
@cb109

Description

@cb109

This is more of a question than an actual issue, please bear with me if it is the wrong place to ask: I have a few tests that rely on ids, which is an issue with PostgreSQL since it does not reset its id counter across tests by default. The TransactionTestCase has a flag to force an id reset: https://docs.djangoproject.com/en/dev/topics/testing/advanced/#django.test.TransactionTestCase.reset_sequences

Do you support setting this flag by a mark or similar (I could not find it yet if existing)? I have currently fallen back to rewriting the test to use the Django testcase but would like to not mix unittest and pytest styles if possible.

If there is no official support yet, would you be be interested in that? I would gladly propose a patch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions