Esempio n. 1
0
    def test_logo_is_empty_if_not_set(self, pyramid_request, org):
        org.logo = None
        ctrl = OrganizationEditController(org, pyramid_request)

        ctx = ctrl.read()

        assert ctx['form']['logo'] == ''
Esempio n. 2
0
    def test_read_does_not_show_delete_button_for_default_org(self, pyramid_request, org):
        org.pubid = '__default__'
        ctrl = OrganizationEditController(org, pyramid_request)

        ctx = ctrl.read()

        assert ctx['delete_url'] is None
Esempio n. 3
0
 def test_read_shows_delete_button(self, pyramid_request, org):
     ctrl = OrganizationEditController(org, pyramid_request)
     ctx = ctrl.read()
     assert ctx['delete_url'] == pyramid_request.route_url('admin.organizations_delete', pubid=org.pubid)
Esempio n. 4
0
 def test_read_presents_org(self, pyramid_request, org):
     ctrl = OrganizationEditController(org, pyramid_request)
     ctx = ctrl.read()
     assert ctx['form'] == self._expected_form(org)