Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ericatkin committed Sep 12, 2024
1 parent a6d06fa commit 24f61d4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_config/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ def view(exc, request): # pragma: no cover
config = self._makeOne(autocommit=True)
self.assertRaises(
ValueError,
lambda: config.add_view(view=view, context=lambda x: x, name=Self),
lambda: config.add_view(view=view, context=lambda x: x),
)

def test_add_view_replaces_self(self):
Expand All @@ -480,16 +480,17 @@ class Foo2:

class Foo: # pragma: no cover
wrapped = Foo2

def __init__(self, request):
pass

def view(self):
pass

config = self._makeOne(autocommit=True)
config.add_view(Foo, context=lambda x: x.wrapped, name=Self, attr='view')
config.add_view(Foo, context=lambda x: x.wrapped, attr='view')
interface = implementedBy(Foo2)
wrapper = self._getViewCallable(config, interface, name='view')
wrapper = self._getViewCallable(config, interface)
self.assertEqual(wrapper.__original_view__, Foo)

def test_add_view_context_as_iface(self):
Expand Down

0 comments on commit 24f61d4

Please sign in to comment.