コード例 #1
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
コード例 #2
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'] == ''
コード例 #3
0
ファイル: admin_organizations_test.py プロジェクト: ziqizh/h
    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'] == ''
コード例 #4
0
ファイル: admin_organizations_test.py プロジェクト: ziqizh/h
    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
コード例 #5
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)
コード例 #6
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)
コード例 #7
0
ファイル: admin_organizations_test.py プロジェクト: ziqizh/h
 def test_read_presents_org(self, pyramid_request, org):
     ctrl = OrganizationEditController(org, pyramid_request)
     ctx = ctrl.read()
     assert ctx['form'] == self._expected_form(org)
コード例 #8
0
ファイル: admin_organizations_test.py プロジェクト: ziqizh/h
 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)