def test_non_empty_user(self): user = User() data = { 'name': { 'fullName': 'Joe Doe', 'firstName': 'Joe', 'lastName': 'Doe' }, 'uid': 'joe.doe', 'roles': [], 'stateCode': [None], 'tenant': None, 'displayHome': False, 'guid': '123' } user.set_name(data['name']) user.set_uid(data['uid']) user.set_guid(data['guid']) name = user.get_name() self.assertEqual(name, {'name': data['name']}) uid = user.get_uid() self.assertEqual(uid, data['uid']) context = user.get_user_context() self.assertEqual(context['displayHome'], data['displayHome']) self.assertEqual(context['guid'], data['guid']) guid = user.get_guid() self.assertEqual(guid, data['guid'])
def test_get_user_context(self): user = User() data = {'name': {'fullName': 'Joe Doe', 'firstName': 'Joe', 'lastName': 'Doe'}, 'uid': 'joe.doe', 'roles': ['TEACHER'], 'tenant': 'dog', 'guid': '123'} user.set_name(data['name']) user.set_uid(data['uid']) user.set_guid(data['guid']) context = user.get_user_context() self.assertEqual(context['uid'], data['uid']) self.assertEqual(context['name'], data['name']) self.assertEqual(context['guid'], data['guid'])
def test_non_empty_user(self): user = User() data = {'name': {'fullName': 'Joe Doe', 'firstName': 'Joe', 'lastName': 'Doe'}, 'uid': 'joe.doe', 'roles': [], 'stateCode': [None], 'tenant': None, 'displayHome': False, 'guid': '123'} user.set_name(data['name']) user.set_uid(data['uid']) user.set_guid(data['guid']) name = user.get_name() self.assertEqual(name, {'name': data['name']}) uid = user.get_uid() self.assertEqual(uid, data['uid']) context = user.get_user_context() self.assertEqual(context['displayHome'], data['displayHome']) self.assertEqual(context['guid'], data['guid']) guid = user.get_guid() self.assertEqual(guid, data['guid'])
def test_get_user_context(self): user = User() data = { 'name': { 'fullName': 'Joe Doe', 'firstName': 'Joe', 'lastName': 'Doe' }, 'uid': 'joe.doe', 'roles': ['TEACHER'], 'tenant': 'dog', 'guid': '123' } user.set_name(data['name']) user.set_uid(data['uid']) user.set_guid(data['guid']) context = user.get_user_context() self.assertEqual(context['uid'], data['uid']) self.assertEqual(context['name'], data['name']) self.assertEqual(context['guid'], data['guid'])