-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Added test for non super user token #77
Conversation
#77 Created a pull request for this issue. I'll be glad to help manage this repo. |
users/tests/conftest.py
Outdated
@pytest.fixture() | ||
async def create_non_superuser(session: AsyncSession) -> Dict[str, str]: | ||
email = "test_user@test.com" | ||
password = "Ksd8nASD1_Hjns!P" | ||
hashed_password = get_password_hash(password) | ||
result = await session.execute(select(User).where(User.email == email)) | ||
user: Optional[User] = result.scalars().first() | ||
if user is None: | ||
session.add(User(email=email, hashed_password=hashed_password, is_superuser=False)) | ||
await session.commit() | ||
return {"email": email, "password": password} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be a scope="session"
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
It looks like the pipeline is not running for PRs? 🤔 |
I can take a look at the pipeline |
Any reason for closing this? 🤔 |
I was eating dinner and working at the same time :), accidentally pushed some unwanted changes, and tried to revert using 'git reset' and that closed this PR. Kindy reopen it :) |
I'm not able to reopen from here. 😅 |
Sorry about this, I've reopened it. |
There are no changes here 👀 |
I've created the test for a non-superuser token, and I've added a fixture that adds a test user and one that gets the user's bearer token.