def test_not_found(self): field = TextField(selector=".not-found") value = field.get_value(self.pq) self.assertIsNone(value)
def test_using_selector(self): field = TextField(selector=".link") value = field.get_value(self.pq) self.assertEqual(value, "Link text.")
def test_using_selector_with_eq(self): field = TextField(selector=".link:eq(1)") value = field.get_value(self.pq) self.assertEqual(value, "Another link.")
def test_no_selector(self): field = TextField() value = field.get_value(self.pq) self.assertEqual(value, "Some text. Link text. Another link.")