I suppose we could take (subscription.date_start - invoice.date_end).days
or (invoice.date_start - subscription.date_end).days where
appropriate...should I change this?


On Tue, Jan 21, 2014 at 3:23 PM, Cory Zue <notifications@github.com> wrote:

> In corehq/apps/accounting/tests/test_invoicing.py:
>
> > +        - unit_cost is prorated
> > +        - quantity > 1
> > +        - subtotal = unit_cost * quantity
> > +        """
> > +        first_invoice_date = utils.months_from_date(self.subscription.date_start, 1)
> > +        tasks.generate_invoices(first_invoice_date)
> > +        last_invoice_date = utils.months_from_date(self.subscription.date_end, 1)
> > +        tasks.generate_invoices(last_invoice_date)
> > +
> > +        for invoice in self.subscription.invoice_set.all():
> > +            product_line_items = invoice.lineitem_set.filter(feature_rate__exact=None)
> > +            self.assertEqual(product_line_items.count(), 1)
> > +
> > +            product_line_item = product_line_items.get()
> > +
> > +            self.assertGreater(product_line_item.quantity, 1)
>
> where does the quantity get set? i would have expected code in the test to
> set mock usage somewhere
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/dimagi/commcare-hq/pull/2275/files#r9052762>
> .
>