示例#1
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')
示例#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")