def test2(self): u"""" Капчи быть не должно """ html = self.get_data('google.html') g = GoogleParser(html) captcha = g.get_captcha_data() self.assertEqual(captcha, None)
def test1(self): u"""" Проверяем на наличие капчи """ html = self.get_data('google-captcha.html') g = GoogleParser(html) captcha = g.get_captcha_data() self.assertEqual(captcha['url'], 'https://www.google.com/sorry/image?id=10009568273031142024&hl=en') self.assertEqual(captcha['captcha_coninue'], 'https://www.google.ru/search?num=10&hl=ru&start=0&q=yandex&as_dt=e') self.assertEqual(captcha['captcha_id'], '10009568273031142024')
def test1(self): u"""" Проверяем на наличие капчи """ html = self.get_data('google-captcha.html') g = GoogleParser(html) captcha = g.get_captcha_data() self.assertEqual( captcha['url'], 'https://www.google.com/sorry/image?id=10009568273031142024&hl=en') self.assertEqual( captcha['captcha_coninue'], 'https://www.google.ru/search?num=10&hl=ru&start=0&q=yandex&as_dt=e' ) self.assertEqual(captcha['captcha_id'], '10009568273031142024')