Files
@ bc5447146f6c
Branch filter:
Location: rattail-project/rattail/tests/db/model/test_customers.py - annotation
bc5447146f6c
1.4 KiB
text/x-python
docs: refactor importer command docs, per typer
ad5e26437c21 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 3b00bd5b289b 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 9cb7ff906833 | # -*- coding: utf-8; -*-
from __future__ import unicode_literals, absolute_import
from rattail.db import model
from ... import DataTestCase
class TestCustomer(DataTestCase):
# TODO: this is duplicated in TestPerson
def test_add_email_address(self):
customer = model.Customer()
self.assertEqual(len(customer.emails), 0)
customer.add_email_address('fred@mailinator.com')
self.assertEqual(len(customer.emails), 1)
email = customer.emails[0]
self.assertEqual(email.type, 'Home')
customer = model.Customer()
self.assertEqual(len(customer.emails), 0)
customer.add_email_address('fred@mailinator.com', type='Work')
self.assertEqual(len(customer.emails), 1)
email = customer.emails[0]
self.assertEqual(email.type, 'Work')
# TODO: this is duplicated in TestPerson
def test_add_phone_number(self):
customer = model.Customer()
self.assertEqual(len(customer.phones), 0)
customer.add_phone_number('417-555-1234')
self.assertEqual(len(customer.phones), 1)
phone = customer.phones[0]
self.assertEqual(phone.type, 'Home')
customer = model.Customer()
self.assertEqual(len(customer.phones), 0)
customer.add_phone_number('417-555-1234', type='Work')
self.assertEqual(len(customer.phones), 1)
phone = customer.phones[0]
self.assertEqual(phone.type, 'Work')
|