def test_list_contacts(self): ''' Verify that the list contacts method returns the list of the user clients as a list of (id, contact) tuples ''' user1 = helpers.create_dummy_user(11) user2 = helpers.create_dummy_user(12) create_dummy_client(1, user1) create_dummy_client(2, user2) create_dummy_client(3, user1) create_dummy_client(4, user2) create_dummy_client(5, user1) create_dummy_client(6, user2) create_dummy_client(7, user1) client_manager_1 = ClientManager(user1) client_manager_2 = ClientManager(user2) clients_1 = client_manager_1.list_clients() clients_2 = client_manager_2.list_clients() self.assertEqual(len(clients_1), 4) self.assertEqual(len(clients_2), 3)
def test_create_user(self): """ Test user creation """ user = helpers.create_dummy_user(1, user_manager = self._user_manager) self.verify_entity_instance(user, UserEntity) self.assertEqual(user.account_type, UserAccountType.FREE) self.assertEqual(user.account_status, UserAccountStatus.ACTIVE)
def setUp(self): super(Test_Invoice_Manager, self).setUp() self._test_user = helpers.create_dummy_user(1) self._test_currency = helpers.create_dummy_currency(1) self._test_language = helpers.create_dummy_language(77) self._test_client = helpers.create_dummy_client(1, self._test_user, currency = self._test_currency) self._invoice_manager = InvoiceManager(self._test_user) self._sub_total = 0 self._total = 0
def setUp(self): super(TestClientManager, self).setUp() self.test_user = helpers.create_dummy_user(1) self.verify_entity_instance(self.test_user, UserEntity) self.client_manager = ClientManager(self.test_user.user)