def test_contact_closed_deals_cases_account(self): """ Test having a contact attached to a contact with no cases or deals. """ assigned_to_user = LilyUserFactory.create(tenant=self.user_obj.tenant, is_active=True) account = AccountFactory.create(tenant=self.user_obj.tenant, assigned_to=assigned_to_user) Function.objects.create(account=account, contact=self.contact) # Make api call. response = self.user.get(reverse(self.search_url, kwargs={'number': self.phone_number.number})) # Verify response. self._verify_response(response, assigned_to_user)
def test_update_modified(self): """ Test that the modified date of a case gets set properly. """ tenant = TenantFactory.create() account = AccountFactory.create(tenant=tenant) modified = account.modified time.sleep(1) account.save(update_modified=False) self.assertEqual(modified, account.modified) account.save(update_modified=True) self.assertNotEqual(modified, account.modified)
def test_contact_closed_deals_cases_account(self): """ Test having a contact attached to a contact with no cases or deals. """ assigned_to_user = LilyUserFactory.create(tenant=self.user_obj.tenant, is_active=True) account = AccountFactory.create(tenant=self.user_obj.tenant, assigned_to=assigned_to_user) Function.objects.create(account=account, contact=self.contact) # Make api call. response = self.user.get( reverse(self.search_url, kwargs={'number': self.phone_number.number})) # Verify response. self._verify_response(response, assigned_to_user)