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
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'] == ''
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'] == ''
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
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)
def test_read_presents_org(self, pyramid_request, org): ctrl = OrganizationEditController(org, pyramid_request) ctx = ctrl.read() assert ctx['form'] == self._expected_form(org)
def test_read_presents_org(self, pyramid_request, org): ctrl = OrganizationEditController(org, pyramid_request) ctx = ctrl.read() assert ctx['form'] == self._expected_form(org)
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)