Skip to content

Commit

Permalink
invoiceitem test complete
Browse files Browse the repository at this point in the history
  • Loading branch information
kavdev committed Jun 10, 2015
1 parent 3e9ae97 commit 5878d13
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
6 changes: 3 additions & 3 deletions djstripe/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,8 +768,9 @@ def handle_event(cls, event):


class InvoiceItem(TimeStampedModel):
""" Not inherited from StripeObject because there can be multiple invoice
items for a single stripe_id.
"""
Not inherited from StripeObject because there can be multiple invoice
items for a single stripe_id.
"""

stripe_id = models.CharField(max_length=50)
Expand All @@ -785,7 +786,6 @@ class InvoiceItem(TimeStampedModel):
quantity = models.IntegerField(null=True)

def plan_display(self):
# TODO - needs test
return djstripe_settings.PAYMENTS_PLANS[self.plan]["name"]


Expand Down
18 changes: 18 additions & 0 deletions tests/test_invoiceitem.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""
.. module:: dj-stripe.tests.test_invoiceitem
:synopsis: dj-stripe InvoiceItem Model Tests.
.. moduleauthor:: Alex Kavanaugh (@kavdev)
"""

from django.test.testcases import TestCase

from djstripe.models import InvoiceItem


class InvoiceItemTest(TestCase):

def test_plan_display(self):
invoiceitem = InvoiceItem(plan="test")
self.assertEqual("Test Plan 1", invoiceitem.plan_display())

0 comments on commit 5878d13

Please sign in to comment.