@@ -0,0 +1,1211 @@
+from decimal import Decimal%0Afrom django.core import mail%0A%0Afrom corehq.apps.accounting.tests.test_invoicing import BaseInvoiceTestCase%0Afrom corehq.apps.accounting import generator, utils, tasks%0Afrom corehq.apps.accounting.invoicing import DomainWireInvoiceFactory%0Afrom corehq.apps.accounting.models import Invoice, WireInvoice%0A%0A%0Aclass TestWireInvoice(BaseInvoiceTestCase):%0A%0A    def setUp(self):%0A        super(TestWireInvoice, self).setUp()%0A        invoice_date = utils.months_from_date(self.subscription.date_start, 2)%0A        tasks.generate_invoices(invoice_date)%0A%0A        invoice_date = utils.months_from_date(self.subscription.date_start, 3)%0A        tasks.generate_invoices(invoice_date)%0A%0A        self.invoices = Invoice.objects.all()%0A        self.domain_name = self.invoices%5B0%5D.get_domain()%0A%0A    def tearDown(self):%0A        super(TestWireInvoice, self).tearDown()%0A%0A    def test_factory(self):%0A        factory = DomainWireInvoiceFactory(self.domain_name)%0A        balance = Decimal(100)%0A%0A        mail.outbox = %5B%5D%0A        wi = factory.create_wire_invoice(balance)%0A%0A        self.assertEqual(wi.balance, balance)%0A        self.assertEqual(wi.domain, self.domain.name)%0A        self.assertEqual(len(mail.outbox), 1)%0A

Test for wire invoice factory