def setUp(self): super(AutocompleteTest, self).setUp() create_employee(username='******') create_employee(username='******') create_employee(username='******') create_employee(username='******') logic.employee.rebuild_index() self.api_key = AccessKey.create('autocomplete key').access_key
def test_get_current_employee(self, mock_get_current_user): employee = create_employee(username='******') mock_get_current_user.return_value = employee.user current_employee = Employee.get_current_employee() self.assertIsNotNone(current_employee) self.assertEqual('john.d', current_employee.username)
def test_delete_subscription(self, mock_model_employee): mock_model_employee.get_current_employee.return_value = create_employee( ) subscription = create_subscription() self.assertIsNotNone(Subscription.get_by_id(subscription.key.id())) logic.subscription.delete_subscription(subscription.key.id()) self.assertIsNone(Subscription.get_by_id(subscription.key.id()))
def test_gravatar_always(self, mock_config): mock_config.GRAVATAR = 'always' employee = create_employee(photo_url='') self.assertEqual(employee.get_gravatar(), employee.get_photo_url()) employee = create_employee(photo_url='http://example.com/example.jpg') self.assertEqual(employee.get_gravatar(), employee.get_photo_url())
def test_full_name(self): employee = create_employee(first_name='Foo', last_name='Bar') self.assertEqual('Foo Bar', employee.full_name)
def setUp(self): self.link = create_love_link(hash_key='HeLLo', recipient_list='johndoe,janedoe', message='well hello there') self.princessbubblegum = create_employee(username='******')
def setUp(self, mock_config): mock_config.DOMAIN = 'example.com' self.current_user = create_employee(username='******')