test_theme_list.py 723 Bytes
Newer Older
Nicolas Joyard's avatar
Nicolas Joyard committed
1
2
3
4
from .base import BaseTest


class ThemeListTest(BaseTest):
Nicolas Joyard's avatar
Nicolas Joyard committed
5
    url = '/themes/'
Nicolas Joyard's avatar
Nicolas Joyard committed
6
7
8
9
10

    def test_queries(self):
        # First query to set session variables
        self.client.get(self.url)

11
        with self.record_performance():
Nicolas Joyard's avatar
Nicolas Joyard committed
12
13
14
15
16
17
            self.client.get(self.url)

    def test_cards(self):
        self.selector_test('.theme-card')

    def test_navbar_order_options(self):
Nicolas Joyard's avatar
Nicolas Joyard committed
18
        self.selector_test('#listheader #sort-menu li')
Nicolas Joyard's avatar
Nicolas Joyard committed
19

Nicolas Joyard's avatar
Nicolas Joyard committed
20
    def test_order_by_name_asc(self):
Nicolas Joyard's avatar
Nicolas Joyard committed
21
        self.selector_test('.theme-card h4',
Nicolas Joyard's avatar
Nicolas Joyard committed
22
                           '%s?sort=name-asc' % self.url)
Nicolas Joyard's avatar
Nicolas Joyard committed
23

Nicolas Joyard's avatar
Nicolas Joyard committed
24
    def test_order_by_name_desc(self):
Nicolas Joyard's avatar
Nicolas Joyard committed
25
        self.selector_test('.theme-card h4',
Nicolas Joyard's avatar
Nicolas Joyard committed
26
                           '%s?sort=name-desc' % self.url)