diff --git a/tests/web/views/corepos/test_members.py b/tests/web/views/corepos/test_members.py index 6055ef9..b3da7b0 100644 --- a/tests/web/views/corepos/test_members.py +++ b/tests/web/views/corepos/test_members.py @@ -1,5 +1,7 @@ # -*- coding: utf-8; -*- +from unittest.mock import patch + from sqlalchemy import orm from corepos.db.office_op import model as op_model @@ -9,7 +11,7 @@ from wuttaweb.testing import WebTestCase from wutta_corepos.web.views.corepos import members as mod -class TestProductView(WebTestCase): +class TestMemberView(WebTestCase): def make_view(self): return mod.MemberView(self.request) @@ -28,8 +30,11 @@ class TestProductView(WebTestCase): view = self.make_view() grid = view.make_grid(model_class=view.model_class) self.assertNotIn('first_name', grid.renderers) - view.configure_grid(grid) + self.assertNotIn('first_name', grid.linked_columns) + with patch.object(self.request, 'is_root', new=True): + view.configure_grid(grid) self.assertIn('first_name', grid.renderers) + self.assertIn('first_name', grid.linked_columns) def test_render_customer_attr(self): view = self.make_view()