@pytest.mark.django_db
def test_admin_regular_user(client, default):
 client.login(username=default.username, password='')
 response = client.get(ADMIN_URL)
 assert (response.status_code == 403)

@ pytest . mark . django_db def test_admin_regular_user ( client , default ) : client . login ( username = default . username , password = '' ) response = client . get ( ADMIN_URL ) assert ( response . status_code == 403 )
checks regular users cannot access the admin site .