Esempio n. 1
0
 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_title(self):
     question = SubmissionFactory(idea="Bogus & Broken")
     self.assertEqual(
         settings.SITE_THEME['TWITTER_QUESTION_TITLE'].format(
             idea=question.idea), question.twitter_title())
Esempio n. 4
0
 def test_twitter_title(self):
     question = SubmissionFactory(idea="Bogus & Broken")
     self.assertEqual(
         settings.SITE_THEME['TWITTER_QUESTION_TITLE'].format(idea=question.idea),
         question.twitter_title()
     )