コード例 #1
0
ファイル: test_subscriber.py プロジェクト: rtouze/GAabo
    def test_mail_sent_updated_special_issue(self):
        sub = Subscriber()
        sub.lastname = 'toto'
        sub.issues_to_receive = 0
        sub.hors_serie1 = 0
        sub.mail_sent = 1
        sub.save()

        self.assertEqual(1, sub.mail_sent)

        sub.hors_serie1 = 1
        sub.save()
        self.assertEqual(0, sub.mail_sent)
コード例 #2
0
    def test_when_mail_already_sent(self):
        """Tests that a subscriber is not exported when he has already reveived
        a resubscription mail and has not re subscribed"""
        sub = Subscriber()
        sub.lastname = 'toto'
        sub.issues_to_receive = 0
        sub.hors_serie1 = 0
        sub.mail_sent = 1
        sub.save()

        self.exporter.do_export()
        f = open_test_file()
        self.assertEquals(1, len(f.readlines()))