def test_get_objects_waiting_for_approval_for_user(self): on_approval_objects = ObjectService.get_objects_waiting_for_approval(self.content_type, self.field, self.user1) self.assertEqual(2, on_approval_objects.count()) self.assertEqual(self.objects[0], on_approval_objects[0]) on_approval_objects = ObjectService.get_objects_waiting_for_approval(self.content_type, self.field, self.user2) self.assertEqual(0, on_approval_objects.count()) on_approval_objects = ObjectService.get_objects_waiting_for_approval(self.content_type, self.field, self.user3) self.assertEqual(0, on_approval_objects.count()) on_approval_objects = ObjectService.get_objects_waiting_for_approval(self.content_type, self.field, self.user4) self.assertEqual(0, on_approval_objects.count())
def test_get_objects_waiting_for_approval_for_user(self): self.initialize_normal_scenario() on_approval_objects = ObjectService.get_objects_waiting_for_approval(self.content_type, self.user1) self.assertEqual(2, on_approval_objects.count()) self.assertEqual(self.objects[0], on_approval_objects[0]) on_approval_objects = ObjectService.get_objects_waiting_for_approval(self.content_type, self.user2) self.assertEqual(0, on_approval_objects.count()) on_approval_objects = ObjectService.get_objects_waiting_for_approval(self.content_type, self.user3) self.assertEqual(0, on_approval_objects.count()) on_approval_objects = ObjectService.get_objects_waiting_for_approval(self.content_type, self.user4) self.assertEqual(0, on_approval_objects.count())
def test_get_objects_waiting_for_approval_for_user(self): on_approval_objects = ObjectService.get_objects_waiting_for_approval( self.content_type, self.field, self.user1) self.assertEqual(2, on_approval_objects.count()) self.assertEqual(self.objects[0], on_approval_objects[0]) on_approval_objects = ObjectService.get_objects_waiting_for_approval( self.content_type, self.field, self.user2) self.assertEqual(0, on_approval_objects.count()) on_approval_objects = ObjectService.get_objects_waiting_for_approval( self.content_type, self.field, self.user3) self.assertEqual(0, on_approval_objects.count()) on_approval_objects = ObjectService.get_objects_waiting_for_approval( self.content_type, self.field, self.user4) self.assertEqual(0, on_approval_objects.count())
def test_get_objects_waiting_for_approval_for_user(self): self.initialize_normal_scenario() on_approval_objects = ObjectService.get_objects_waiting_for_approval( self.content_type, self.user1) self.assertEqual(2, on_approval_objects.count()) self.assertEqual(self.objects[0], on_approval_objects[0]) on_approval_objects = ObjectService.get_objects_waiting_for_approval( self.content_type, self.user2) self.assertEqual(0, on_approval_objects.count()) on_approval_objects = ObjectService.get_objects_waiting_for_approval( self.content_type, self.user3) self.assertEqual(0, on_approval_objects.count()) on_approval_objects = ObjectService.get_objects_waiting_for_approval( self.content_type, self.user4) self.assertEqual(0, on_approval_objects.count())
def get_objects_waiting_for_approval(self, user): return ObjectService.get_objects_waiting_for_approval( ContentType.objects.get_for_model(self.model), user)
def get_objects_waiting_for_approval(self, user): return ObjectService.get_objects_waiting_for_approval(ContentType.objects.get_for_model(self.model), user)