Last active
May 16, 2022 18:46
-
-
Save Bahus/4a596832333544439e33054a970fbdb8 to your computer and use it in GitHub Desktop.
This file contains 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
from http import HTTPStatus | |
import pytest | |
def browser_client(request): | |
user_name = request.param | |
credentials = get_credentials_for_user(user_name) | |
client = Client() | |
client.login(**credentials) | |
client.user = user_name | |
return client | |
@pytest.mark.parametrize( | |
'browser_client, expected_status_code', | |
[ | |
('admin', HTTPStatus.OK), | |
('manager', HTTPStatus.FORBIDDEN), | |
], | |
indirect=['browser_client'], | |
) | |
def test_url_access(browser_client, expected_status_code): | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment