def test_read_renders_form_if_group_has_no_creator(self, pyramid_request, group): group.creator = None view = GroupEditViews(group, pyramid_request) ctx = view.read() assert ctx["form"] == self._expected_form(group)
def test_read_renders_form_if_group_has_no_creator(self, pyramid_request, group): group.creator = None view = GroupEditViews(group, pyramid_request) ctx = view.read() assert ctx["form"] == self._expected_form(group)
def test_read_renders_form_if_group_has_no_creator(self, pyramid_request, group): group.creator = None view = GroupEditViews(GroupContext(group), pyramid_request) response = view.read() assert response["form"] == self._expected_form(group)
def test_read_renders_form(self, pyramid_request, factories, group): factories.Annotation(groupid=group.pubid) factories.Annotation(groupid=group.pubid) view = GroupEditViews(group, pyramid_request) ctx = view.read() assert ctx["form"] == self._expected_form(group) assert ctx["pubid"] == group.pubid assert ctx["group_name"] == group.name assert ctx["member_count"] == len(group.members) assert ctx["annotation_count"] == 2
def test_read_renders_form(self, pyramid_request, factories, group): factories.Annotation(groupid=group.pubid) factories.Annotation(groupid=group.pubid) view = GroupEditViews(group, pyramid_request) ctx = view.read() assert ctx["form"] == self._expected_form(group) assert ctx["pubid"] == group.pubid assert ctx["group_name"] == group.name assert ctx["member_count"] == len(group.members) assert ctx["annotation_count"] == 2