def test_data(self, send_mail_jinja):
        with self.settings(SITE_URL='http://f.com'):
            tasks.send_purchase_receipt(self.contrib.pk)

        args = send_mail_jinja.call_args
        data = args[0][3]

        eq_(args[1]['recipient_list'], [self.user.email])
        eq_(data['app_name'], self.addon.name)
        eq_(data['developer_name'], self.addon.current_version.developer_name)
        eq_(data['price'], self.contrib.get_amount_locale('en_US'))
        ok_(data['purchases_url'].startswith('http://f.com'))
Example #2
0
    def test_data(self, send_mail_jinja):
        with self.settings(SITE_URL='http://f.com'):
            tasks.send_purchase_receipt(self.contrib.pk)

        args = send_mail_jinja.call_args
        data = args[0][3]

        eq_(args[1]['recipient_list'], [self.user.email])
        eq_(data['app_name'], self.addon.name)
        eq_(data['developer_name'], self.addon.current_version.developer_name)
        eq_(data['price'], self.contrib.get_amount_locale('en_US'))
        ok_(data['purchases_url'].startswith('http://f.com'))
 def test_localized_send(self):
     self.contrib.user.lang = 'es'
     self.contrib.user.save()
     tasks.send_purchase_receipt(self.contrib.pk)
     assert 'Precio' in mail.outbox[0].body
     assert 'Algo Algo' in mail.outbox[0].body
 def test_send(self):
     tasks.send_purchase_receipt(self.contrib.pk)
     eq_(len(mail.outbox), 1)
Example #5
0
 def test_localized_send(self):
     self.contrib.user.lang = 'es'
     self.contrib.user.save()
     tasks.send_purchase_receipt(self.contrib.pk)
     assert 'Precio' in mail.outbox[0].body
     assert 'Algo Algo' in mail.outbox[0].body
Example #6
0
 def test_send(self):
     tasks.send_purchase_receipt(self.contrib.pk)
     eq_(len(mail.outbox), 1)