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')
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")
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")