Skip to content

Commit

Permalink
fix query in test_views
Browse files Browse the repository at this point in the history
  • Loading branch information
mmerickel committed Feb 5, 2024
1 parent 3069052 commit 85e9b2a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions docs/tutorials/wiki2/src/tests/tests/test_views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from pyramid.testing import DummySecurityPolicy
import sqlalchemy as sa

from tutorial import models

Expand Down Expand Up @@ -93,11 +94,9 @@ def test_submit_works(self, dummy_config, dummy_request, dbsession):
setUser(dummy_config, makeUser('foo', 'editor'))
self._addRoutes(dummy_config)
self._callFUT(dummy_request)
page = (
dbsession.query(models.Page)
.filter_by(name='AnotherPage')
.one()
)
page = dbsession.scalars(
sa.select(models.Page).where(models.Page.name == 'AnotherPage')
).one()
assert page.data == 'Hello yo!'

class Test_edit_page:
Expand Down

0 comments on commit 85e9b2a

Please sign in to comment.