Skip to content
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

Key (modified_by_id)=(1) is not present in table "account_customuser" when running unit test #47

Closed
paulexconde opened this issue Mar 8, 2021 · 3 comments

Comments

@paulexconde
Copy link

No description provided.

@bethlakshmi
Copy link

I'm having the same problem

@zvyn
Copy link

zvyn commented Dec 23, 2021

A workaround is to set the user to None explicitly when setting up the test. For pytest this works for me:

@pytest.fixture(autouse=True)
def unset_user():
    from django_currentuser.middleware import _set_current_user

    _set_current_user()

@paulexconde
Copy link
Author

A workaround is to set the user to None explicitly when setting up the test. For pytest this works for me:

@pytest.fixture(autouse=True)
def unset_user():
    from django_currentuser.middleware import _set_current_user

    _set_current_user()

@zvyn , Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants