def test_twitter_question_card(self): question = SubmissionFactory(idea="Bogus & Broken") rsp = self.client.get(question.get_absolute_url()) self.assertContains(rsp, '<meta name="twitter:card" content="summary_large_image">') self.assertContains(rsp, '<meta name="twitter:title" content="%s">' % escape(question.twitter_title())) self.assertContains(rsp, '<meta name="twitter:description" content="%s">' % escape(question.twitter_description())) self.assertContains( rsp, '<meta name="twitter:image" content="%s">' % settings.SITE_THEME['TWITTER_IMAGE'] )
def test_twitter_question_card(self): question = SubmissionFactory(idea="Bogus & Broken") rsp = self.client.get(question.get_absolute_url()) self.assertContains( rsp, '<meta name="twitter:card" content="summary_large_image">') self.assertContains( rsp, '<meta name="twitter:title" content="%s">' % escape(question.twitter_title())) self.assertContains( rsp, '<meta name="twitter:description" content="%s">' % escape(question.twitter_description())) self.assertContains( rsp, '<meta name="twitter:image" content="%s">' % settings.SITE_THEME['TWITTER_IMAGE'])
def test_twitter_description(self): question = SubmissionFactory(idea="Bogus & Broken") self.assertEqual( settings.SITE_THEME['TWITTER_QUESTION_DESCRIPTION'].format( idea=question.idea), question.twitter_description())
def test_twitter_description(self): question = SubmissionFactory(idea="Bogus & Broken") self.assertEqual( settings.SITE_THEME['TWITTER_QUESTION_DESCRIPTION'].format(idea=question.idea), question.twitter_description() )