예제 #1
0
파일: test_models.py 프로젝트: zzdjk6/kuma
    def setUp(self):
        self.user, self.admin_user, self.other_user = make_users()

        hidden_prev_demo = build_hidden_submission(self.other_user,
                                                   'hidden-submission-1')

        self.submission = build_submission(self.user)
        self.old_blacklist = demos.models.DEMO_MIMETYPE_BLACKLIST

        hidden_next_demo = build_hidden_submission(self.other_user,
                                                   'hidden-submission-2')
예제 #2
0
    def setUp(self):
        self.user, self.admin_user, self.other_user = make_users()

        hidden_prev_demo = build_hidden_submission(self.other_user,
                                                   'hidden-submission-1')

        self.submission = build_submission(self.user)
        self.old_blacklist = demos.models.DEMO_MIMETYPE_BLACKLIST

        hidden_next_demo = build_hidden_submission(self.other_user,
                                                   'hidden-submission-2')
예제 #3
0
    def test_all_demos_includes_hidden_for_staff(self):
        build_submission(self.user)
        build_hidden_submission(self.user)

        r = self.client.get(reverse("demos_all"))
        count = pq(r.content)("h2.count").text()
        eq_(count, "1 Demo")

        self.client.login(username=self.admin_user.username, password="******")
        r = self.client.get(reverse("demos_all"))
        count = pq(r.content)("h2.count").text()
        eq_(count, "2 Demos")
예제 #4
0
    def test_all_demos_includes_hidden_for_staff(self):
        build_submission(self.user)
        build_hidden_submission(self.user)

        r = self.client.get(reverse('demos_all'))
        count = pq(r.content)('h2.count').text()
        eq_(count, "1 Demo")

        self.client.login(username=self.admin_user.username,
                          password='******')
        r = self.client.get(reverse('demos_all'))
        count = pq(r.content)('h2.count').text()
        eq_(count, "2 Demos")