dsc / pyquery

A jQuery-like library for Python (fork of https://bitbucket.org/olauzanne/pyquery/)
Other
105 stars 7 forks source link

hasClass('test') returns True when children have class 'test' #2

Closed pcraciunoiu closed 13 years ago

pcraciunoiu commented 13 years ago

Test case for test.py:

class TestHasClass(unittest.TestCase):
    def test_child_has_class(self):
        doc = pq("""<div id="test" class="on"><div class="off"></div></div>""")
        assert doc('#test').hasClass('on')
        assert not doc('#test').hasClass('off')

I'll file a pull request.