mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-10 00:28:22 -05:00
make the tests check for any error message
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
from cookbook.models import Storage
|
||||
from django.contrib import auth
|
||||
from django.urls import reverse
|
||||
import pytest
|
||||
from django.contrib import auth
|
||||
from django.contrib import messages
|
||||
from django.contrib.messages import get_messages
|
||||
from django.urls import reverse
|
||||
|
||||
from cookbook.models import Storage
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -29,6 +32,9 @@ def test_edit_storage(storage_obj, a1_s1, a1_s2):
|
||||
)
|
||||
storage_obj.refresh_from_db()
|
||||
assert r.status_code == 200
|
||||
r_messages = [m for m in get_messages(r.wsgi_request)]
|
||||
assert not any(m.level > messages.SUCCESS for m in r_messages)
|
||||
|
||||
assert storage_obj.password == '1234_pw'
|
||||
assert storage_obj.token == '1234_token'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user