Exemplo n.º 1
0
 def test_email_format_and_content(self):
     ReportFactory.create(email='*****@*****.**',
                          comment="This is a 'comment'")
     sent_mail = mail.outbox[0]
     self.assertEqual(sent_mail.subject,
                      '[Geotrek] Feedback from [email protected]')
     self.assertIn("Comment : This is a 'comment'", sent_mail.body)
     self.assertIn("Lat : 46.500000 / Lon : 3.000000", sent_mail.body)
Exemplo n.º 2
0
 def test_email_format_and_content(self):
     ReportFactory.create(name=u'John Doe',
                          email=u'*****@*****.**',
                          comment=u'This is a comment')
     sent_mail = mail.outbox[0]
     self.assertEquals(sent_mail.subject,
                       u'[Geotrek] Feedback from John Doe ([email protected])')
     self.assertIn(u"Comment : This is a comment", sent_mail.body)
     self.assertIn(u"Lat : 1.13 / Lon : 2.26", sent_mail.body)
Exemplo n.º 3
0
 def test_email_format_and_content(self):
     ReportFactory.create(name=u'John Doe',
                          email=u'*****@*****.**',
                          comment=u'This is a comment')
     sent_mail = mail.outbox[0]
     self.assertEquals(
         sent_mail.subject,
         u'[Geotrek] Feedback from John Doe ([email protected])')
     self.assertIn(u"Comment : This is a comment", sent_mail.body)
     self.assertIn(u"Lat : 46.5 / Lon : 3", sent_mail.body)
Exemplo n.º 4
0
    def test_email_format_and_content_fr(self):
        translation.activate('fr')
        ReportFactory.create(email='*****@*****.**',
                             comment="Ceci est un commentaire")
        sent_mail = mail.outbox[0]
        self.assertEqual(
            sent_mail.subject,
            '[Geotrek] Signalement de [email protected]')
        self.assertIn("Commentaire : Ceci est un commentaire", sent_mail.body)
        self.assertIn("Lat : 46.500000 / Lon : 3.000000", sent_mail.body)
        self.assertIn(
            "http://www.openstreetmap.org/?mlat=46.500000&mlon=3.000000",
            sent_mail.body)

        translation.deactivate()
Exemplo n.º 5
0
 def test_email_format_and_content(self):
     ReportFactory.create(name=u"John Doe", email=u"*****@*****.**", comment=u"This is a comment")
     sent_mail = mail.outbox[0]
     self.assertEquals(sent_mail.subject, u"[Geotrek] Feedback from John Doe ([email protected])")
     self.assertIn(u"Comment : This is a comment", sent_mail.body)
     self.assertIn(u"Lat : 46.5 / Lon : 3", sent_mail.body)
Exemplo n.º 6
0
 def test_email_failure_does_not_prevent_report_creation(self):
     r = ReportFactory.create()
     self.assertEquals(len(mail.outbox), 0)
     self.assertIsNotNone(r.id)
Exemplo n.º 7
0
 def test_a_mail_is_not_sent_on_report_modification(self):
     r = ReportFactory.create()
     self.assertEquals(len(mail.outbox), 1)
     r.name = "toto"
     r.save()
     self.assertEquals(len(mail.outbox), 1)
Exemplo n.º 8
0
 def test_a_mail_is_sent_on_report_creation(self):
     ReportFactory.create()
     self.assertEquals(len(mail.outbox), 1)
Exemplo n.º 9
0
 def test_email_failure_does_not_prevent_report_creation(self):
     r = ReportFactory.create()
     self.assertEquals(len(mail.outbox), 0)
     self.assertIsNotNone(r.id)
Exemplo n.º 10
0
 def test_a_mail_is_not_sent_on_report_modification(self):
     r = ReportFactory.create()
     self.assertEquals(len(mail.outbox), 1)
     r.name = 'toto'
     r.save()
     self.assertEquals(len(mail.outbox), 1)
Exemplo n.º 11
0
 def test_a_mail_is_sent_on_report_creation(self):
     ReportFactory.create()
     self.assertEquals(len(mail.outbox), 1)
Exemplo n.º 12
0
 def test_a_mail_is_not_sent_on_report_modification(self):
     r = ReportFactory.create()
     self.assertEqual(len(mail.outbox), 1)
     r.comment = 'More info about it'
     r.save()
     self.assertEqual(len(mail.outbox), 1)