当前位置: 首页>>代码示例>>Python>>正文


Python fixtures.get_application函数代码示例

本文整理汇总了Python中us_ignite.apps.tests.fixtures.get_application函数的典型用法代码示例。如果您正苦于以下问题:Python get_application函数的具体用法?Python get_application怎么用?Python get_application使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_application函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_non_published_applications_are_not_shown

 def test_non_published_applications_are_not_shown(self):
     fixtures.get_application(
         name='Gigabit app', status=Application.DRAFT)
     response = views.app_list(self.factory.get('/app/'))
     eq_(response.status_code, 200)
     eq_(len(response.context_data['page'].object_list), 0)
     _teardown_apps()
开发者ID:jendc123,项目名称:us_ignite,代码行数:7,代码来源:views_tests.py

示例2: test_applications_are_reverse_sorted

 def test_applications_are_reverse_sorted(self):
     owner = get_user('us-ignite')
     app_a = fixtures.get_application(
         name='alpha app', status=Application.PUBLISHED, owner=owner)
     app_b = fixtures.get_application(
         name='beta app', status=Application.PUBLISHED, owner=owner)
     response = views.app_list(self.factory.get('/app/', {'order': '-name'}))
     eq_(list(response.context_data['page'].object_list), [app_b, app_a])
     _teardown_apps()
开发者ID:jendc123,项目名称:us_ignite,代码行数:9,代码来源:views_tests.py

示例3: test_applications_are_listed_by_domain

 def test_applications_are_listed_by_domain(self):
     domain = fixtures.get_domain(name='foo')
     owner = get_user('us-ignite')
     app_a = fixtures.get_application(
         name='alpha app', status=Application.PUBLISHED, owner=owner,
         domain=domain)
     fixtures.get_application(
         name='beta app', status=Application.PUBLISHED, owner=owner)
     response = views.app_list(self.factory.get('/app/foo/'), 'foo')
     eq_(response.status_code, 200)
     eq_(response.template_name, 'apps/object_list.html')
     eq_(list(response.context_data['page'].object_list), [app_a])
     _teardown_apps()
开发者ID:jendc123,项目名称:us_ignite,代码行数:13,代码来源:views_tests.py

示例4: test_get_entries_for_apps_returns_entry

 def test_get_entries_for_apps_returns_entry(self):
     user = get_user('us-ignite')
     challenge = fixtures.get_challenge(user=user)
     application = get_application(owner=user)
     entry = fixtures.get_entry(application, challenge=challenge)
     result = Entry.objects.get_entries_for_apps(challenge, [application])
     eq_(result, [AppEntry(application=application, entry=entry)])
开发者ID:jendc123,项目名称:us_ignite,代码行数:7,代码来源:managers_tests.py

示例5: test_published_applications_are_listed

 def test_published_applications_are_listed(self):
     app = fixtures.get_application(
         name='Gigabit app', status=Application.PUBLISHED)
     response = views.app_list(self.factory.get('/app/'))
     eq_(response.status_code, 200)
     eq_(list(response.context_data['page'].object_list), [app])
     _teardown_apps()
开发者ID:jendc123,项目名称:us_ignite,代码行数:7,代码来源:views_tests.py

示例6: test_application_member_membership

 def test_application_member_membership(self):
     user = get_user('app-owner')
     member = get_user('app-member')
     application = fixtures.get_application(owner=user)
     models.ApplicationMembership.objects.create(
         application=application, user=member)
     ok_(application.has_member(member))
开发者ID:jendc123,项目名称:us_ignite,代码行数:7,代码来源:models_tests.py

示例7: test_valid_payload_succeeds

 def test_valid_payload_succeeds(self):
     user = get_user('us-ignite')
     challenge = fixtures.get_challenge(
         user=user, status=Challenge.PUBLISHED)
     app = get_application(owner=user, status=Application.PUBLISHED)
     question = fixtures.get_question(challenge)
     entry = fixtures.get_entry(app)
     EntryAnswer.get_or_create_answer(
         entry, question, 'Uses Gigabit features.')
     question_id = 'question_%s' % question.id
     data = {
         'status': Entry.SUBMITTED,
         question_id: 'Answer for the question!'
     }
     url = '/challenges/%s/enter/%s/' % (challenge.slug, app.slug)
     request = utils.get_request('post', url, data=data, user=user)
     request._messages = utils.TestMessagesBackend(request)
     response = views.challenge_entry(
         request, challenge.slug, app.slug)
     eq_(response.status_code, 302)
     eq_(response['location'], url)
     entry = Entry.objects.get_entry_or_none(challenge, app)
     values = entry.entryanswer_set.values('answer', 'question_id').all()
     expected = [{
         'answer': 'Answer for the question!',
         'question_id': question.id
     }]
     eq_(list(values), expected)
开发者ID:jendc123,项目名称:us_ignite,代码行数:28,代码来源:views_tests.py

示例8: test_is_not_visible_when_is_draft

 def test_is_not_visible_when_is_draft(self):
     user = get_user('us-ignite')
     challenge = fixtures.get_challenge(user=user)
     application = get_application(owner=user)
     entry = fixtures.get_entry(
         application, challenge=challenge, status=Entry.DRAFT)
     eq_(entry.is_visible_by(utils.get_anon_mock()), False)
开发者ID:jendc123,项目名称:us_ignite,代码行数:7,代码来源:models_tests.py

示例9: test_is_visible_for_owners

 def test_is_visible_for_owners(self):
     user = get_user('us-ignite')
     challenge = fixtures.get_challenge(user=user)
     application = get_application(owner=user)
     entry = fixtures.get_entry(
         application, challenge=challenge, status=Entry.DRAFT)
     eq_(entry.is_visible_by(user), True)
开发者ID:jendc123,项目名称:us_ignite,代码行数:7,代码来源:models_tests.py

示例10: test_is_visible_for_published_challenges

 def test_is_visible_for_published_challenges(self):
     user = get_user('us-ignite')
     challenge = fixtures.get_challenge(user=user)
     application = get_application(owner=user)
     entry = fixtures.get_entry(
         application, challenge=challenge, status=Entry.SUBMITTED)
     eq_(entry.is_visible_by(utils.get_anon_mock()), True)
开发者ID:jendc123,项目名称:us_ignite,代码行数:7,代码来源:models_tests.py

示例11: test_instance_is_draft

 def test_instance_is_draft(self):
     user = get_user('us-ignite')
     challenge = fixtures.get_challenge(user=user)
     application = get_application(owner=user)
     entry = fixtures.get_entry(
         application, challenge=challenge, status=Entry.DRAFT)
     eq_(entry.is_draft(), True)
开发者ID:jendc123,项目名称:us_ignite,代码行数:7,代码来源:models_tests.py

示例12: test_instance_is_submitted

 def test_instance_is_submitted(self):
     user = get_user('us-ignite')
     challenge = fixtures.get_challenge(user=user)
     application = get_application(owner=user)
     entry = fixtures.get_entry(
         application, challenge=challenge, status=Entry.SUBMITTED)
     eq_(entry.is_submitted(), True)
开发者ID:jendc123,项目名称:us_ignite,代码行数:7,代码来源:models_tests.py

示例13: test_existing_entry_is_returned

 def test_existing_entry_is_returned(self):
     user = get_user('us-ignite')
     challenge = fixtures.get_challenge(user=user)
     application = get_application(owner=user)
     entry = fixtures.get_entry(
         application, challenge=challenge, status=Entry.SUBMITTED)
     eq_(Entry.objects.get_entry_or_none(challenge, application), entry)
开发者ID:jendc123,项目名称:us_ignite,代码行数:7,代码来源:managers_tests.py

示例14: test_app_is_not_editable_by_member

 def test_app_is_not_editable_by_member(self):
     user = get_user('app-owner')
     member = get_user('member')
     application = fixtures.get_application(
         owner=user, status=models.Application.DRAFT)
     models.ApplicationMembership.objects.create(
         application=application, user=member, can_edit=False)
     eq_(application.is_editable_by(member), False)
开发者ID:jendc123,项目名称:us_ignite,代码行数:8,代码来源:models_tests.py

示例15: test_draft_app_is_visible_by_member

 def test_draft_app_is_visible_by_member(self):
     user = get_user('app-owner')
     member = get_user('app-member')
     application = fixtures.get_application(
         owner=user, status=models.Application.DRAFT)
     models.ApplicationMembership.objects.create(
         application=application, user=member)
     ok_(application.is_visible_by(member))
开发者ID:jendc123,项目名称:us_ignite,代码行数:8,代码来源:models_tests.py


注:本文中的us_ignite.apps.tests.fixtures.get_application函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。