def test_extract_ids(self):
     '''
     test that actor ids are returned correctly
     TODO: move to common test suite
     '''
     json_dict = json.loads(create_actor_data())
     actor_ids = extract_ids(json_dict, 'selectedActors')
     self.assertEqual(actor_ids, ['1', '2', ])
 def test_extract_ids(self):
     '''
     test that actor ids are returned correctly
     TODO: move to common test suite
     '''
     json_dict = json.loads(create_actor_data())
     actor_ids = extract_ids(json_dict, 'selectedActors')
     self.assertEqual(actor_ids, [
         '1',
         '2',
     ])
 def test_actor_update_from_query_dict(self):
     '''
     test that the actor gets updated correctly from the query dict
     passed in the request
     '''
     json_dict = json.loads(create_actor_data())
     json_dict['user'] = self.user
     json_dict = process_actor_data(json_dict)
     actor_ids = extract_ids(json_dict, 'selectedActors')
     actor = Actor.objects.get(id=1)
     actor.position_en = u'position'
     actor.save()
     actor_objects = Actor.objects.filter(id__in=actor_ids)
     update_entities(json_dict, actor_objects, [])
     actor_1 = Actor.objects.get(id=1)
     actor_2 = Actor.objects.get(id=2)
     self.assertEqual(actor_1.occupation_en, 'Farmer')
     self.assertEqual(actor_1.position_en, 'position')
     self.assertEqual(actor_1.current_location.id, 1)
     self.assertEqual(actor_2.occupation_en, 'Farmer')
 def test_actor_update_from_query_dict(self):
     '''
     test that the actor gets updated correctly from the query dict
     passed in the request
     '''
     json_dict = json.loads(create_actor_data())
     json_dict['user'] = self.user
     json_dict = process_actor_data(json_dict)
     actor_ids = extract_ids(json_dict, 'selectedActors')
     actor = Actor.objects.get(id=1)
     actor.position_en = u'position'
     actor.save()
     actor_objects = Actor.objects.filter(
         id__in=actor_ids
     )
     update_entities(json_dict, actor_objects, [])
     actor_1 = Actor.objects.get(id=1)
     actor_2 = Actor.objects.get(id=2)
     self.assertEqual(actor_1.occupation_en, 'Farmer')
     self.assertEqual(actor_1.position_en, 'position')
     self.assertEqual(actor_1.current_location.id, 1)
     self.assertEqual(actor_2.occupation_en, 'Farmer')