Exemplo n.º 1
0
    def setUp(self):
        super(BaseTestRequests, self).setUp()
        create_test_map()

        self.fixture = ForumFixture(self.accounts_factory)

        self.account = self.fixture.account_1
        self.account_2 = self.fixture.account_2

        self.request_login(self.account.email)

        # cat1
        # |-subcat1
        # | |-thread1
        # | | |-post1
        # | |-thread2
        # |-subcat2
        # cat2
        # | subcat3
        # | |- thread3
        # cat3

        self.cat1 = self.fixture.cat_1
        # to test, that subcat.id not correlate with order
        self.subcat2 = self.fixture.subcat_2
        self.subcat1 = self.fixture.subcat_1
        self.cat2 = self.fixture.cat_2
        self.subcat3 = self.fixture.subcat_3
        self.cat3 = self.fixture.cat_3

        self.thread1 = self.fixture.thread_1
        self.thread2 = self.fixture.thread_2
        self.thread3 = self.fixture.thread_3

        self.post1 = self.fixture.post_1
Exemplo n.º 2
0
 def test_hot_themes__show_all(self):
     forum = ForumFixture(self.accounts_factory)
     self.check_html_ok(self.request_html(url('portal:')),
                        texts=[
                            forum.thread_1.caption, forum.thread_2.caption,
                            forum.thread_3.caption
                        ])
Exemplo n.º 3
0
 def test_hot_themes__hide_restricted_themes(self):
     forum = ForumFixture(self.accounts_factory)
     forum.subcat_3._model.restricted = True
     forum.subcat_3.save()
     self.check_html_ok(self.request_html(url('portal:')),
                        texts=[
                            forum.thread_1.caption, forum.thread_2.caption,
                            (forum.thread_3.caption, 0)
                        ])