Commit 641cfca3 authored by Michal Čihař's avatar Michal Čihař

Include project names in the name of billing

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 1ed5c0b1
...@@ -74,7 +74,10 @@ class Billing(models.Model): ...@@ -74,7 +74,10 @@ class Billing(models.Model):
) )
def __str__(self): def __str__(self):
return '{0} ({1})'.format(self.user, self.plan) return '{0}: {1} ({2})'.format(
', '.join([str(x) for x in self.projects.all()]),
self.user, self.plan
)
def count_changes(self, interval): def count_changes(self, interval):
return Change.objects.filter( return Change.objects.filter(
......
...@@ -69,15 +69,15 @@ class BillingTest(TestCase): ...@@ -69,15 +69,15 @@ class BillingTest(TestCase):
call_command('billing_check', stdout=out) call_command('billing_check', stdout=out)
self.assertEqual( self.assertEqual(
out.getvalue(), out.getvalue(),
'Following billings are over limit:\n * bill (test)\n' 'Following billings are over limit:\n * test0, test1: bill (test)\n'
) )
self.invoice.delete() self.invoice.delete()
out = StringIO() out = StringIO()
call_command('billing_check', stdout=out) call_command('billing_check', stdout=out)
self.assertEqual( self.assertEqual(
out.getvalue(), out.getvalue(),
'Following billings are over limit:\n * bill (test)\n' 'Following billings are over limit:\n * test0, test1: bill (test)\n'
'Following billings are past due date:\n * bill (test)\n' 'Following billings are past due date:\n * test0, test1: bill (test)\n'
) )
def test_invoice_validation(self): def test_invoice_validation(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment