def test_add_link(self): title = u'Вставка ссылки' main_text = u'' self.create_page.create_simple_topic(self.BLOG, title, main_text) self.create_page.form.add_link_to_main_text(u'http://tech-mail.ru', u'Технопарк') self.create_page.form.submit() topic = TopicPage(self.driver).topic self.assertIn('href="http://tech-mail.ru"', topic.get_inner_html_text()) self.assertEqual(u'Технопарк', topic.get_text())
def test_cut_tag(self): title = u'Тестирование тега <cut>' short_text = u'Текст в блоге' main_text = u'Текст в топике' text = short_text + u'<cut>' + main_text + u'</cut>' self.create_page.create_simple_topic(self.BLOG, title, text) self.create_page.form.submit() topic = TopicPage(self.driver).topic self.assertEqual(topic.get_title(), title) self.assertEqual(topic.get_text(), short_text + u' ' + main_text) topic.open_blog() blog = BlogPage(self.driver).blog self.assertIn(short_text, blog.get_text()) self.assertNotIn(main_text, blog.get_text())
def test_create_simple_topic(self): title = u'Тестовый заголовок' main_text = u'Основной текст' self.create_page.create_simple_topic(self.BLOG, title, main_text) self.create_page.form.submit() topic = TopicPage(self.driver).topic self.assertEqual(topic.get_title(), title) self.assertEqual(topic.get_text(), main_text) topic.open_blog() blog = BlogPage(self.driver).blog self.assertEqual(blog.get_title(), title) self.assertEqual(blog.get_text(), main_text) topic.delete() self.assertNotEqual(blog.get_title(), title) self.assertNotEqual(blog.get_text(), main_text)