Ejemplo n.º 1
0
    def test_css_with(self):
        css = CSS()
        with css.selector(".home") as selector:
            selector.append(Style("a", "b"))
            selector.append(Style("c", "d"))

        self.assertEqual(css.render(), self.rendered_css)
Ejemplo n.º 2
0
    def test_css_auto_add(self):
        css = CSS()
        DARWCSS_AUTO = True

        with css.selector(".home") as selector:
            Style("a", "b")
            Style("c", "d")

        self.assertEqual(css.render(), self.rendered_css)
Ejemplo n.º 3
0
    def test_css_auto_add_different_selector(self):
        css = CSS()
        DARWCSS_AUTO = True
        DARWCSS_SELECTOR = "test"

        with css.selector(".home") as test:
            Style("a", "b")
            Style("c", "d")

        self.assertEqual(css.render(), self.rendered_css)