Refactor NoneType test to make use of the __str__ method thus including that method in the test as well.

This commit is contained in:
Tom Price
2015-12-22 23:07:15 +00:00
parent 48969ed95c
commit b7018d5c44

View File

@@ -7,9 +7,9 @@ from decimal import *
class ProfileTestCase(TestCase):
def test_str(self):
profile = models.Profile(first_name='Test', last_name='Case')
self.assertEqual(profile.name, 'Test Case')
self.assertEqual(str(profile), 'Test Case')
profile.initials = 'TC'
self.assertEqual(profile.name, 'Test Case "TC"')
self.assertEqual(str(profile), 'Test Case "TC"')
class VatRateTestCase(TestCase):