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

Added test for non super user token #77

Closed
wants to merge 2 commits into from
Closed

Conversation

hasnain095
Copy link
Contributor

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.

@hasnain095
Copy link
Contributor Author

#77 Created a pull request for this issue. I'll be glad to help manage this repo.

Comment on lines 61 to 71
@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}
Copy link
Owner

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@Kludex
Copy link
Owner

Kludex commented Apr 3, 2023

It looks like the pipeline is not running for PRs? 🤔

@hasnain095
Copy link
Contributor Author

I can take a look at the pipeline

@Kludex
Copy link
Owner

Kludex commented Apr 3, 2023

Any reason for closing this? 🤔

@hasnain095
Copy link
Contributor Author

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 :)

@Kludex
Copy link
Owner

Kludex commented Apr 3, 2023

I'm not able to reopen from here. 😅

@hasnain095 hasnain095 reopened this Apr 3, 2023
@hasnain095
Copy link
Contributor Author

Sorry about this, I've reopened it.

@Kludex
Copy link
Owner

Kludex commented Apr 4, 2023

There are no changes here 👀

@hasnain095 hasnain095 closed this Apr 4, 2023
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

Successfully merging this pull request may close these issues.

None yet

2 participants