Exemple #1
0
 def test_requiring_work(self):
     # check if return all the streams with pending material statusese.
     self.assertEquals(len(Stream.requiring_work()), 1)
     self.assertEquals(Stream.requiring_work()[0], self.stream)
     [ms.clone_for(self.other_stream) for ms in self.stream.materials.all()]
     self.assertEquals(len(Stream.requiring_work()), 2)
     self.assertEquals(Stream.requiring_work()[0], self.stream)
Exemple #2
0
 def wrap(managers, ids):
     self.flag = True
     l = Stream.requiring_work().values_list('id', flat=True)
     self.assertEquals(len(ids), len(l))
     for i in ids:
         self.assertIn(i, l)
     return original_map(managers, ids)
Exemple #3
0
 def step(self):
     ids = Stream.requiring_work().values_list('id', flat=True)
     # here the map function should not return any value.
     self.managers.map(manager_job, ids)
     connection.close()
Exemple #4
0
 def step(self):
     ids = Stream.requiring_work().values_list('id', flat=True)
     # here the map function should not return any value.
     self.managers.map(manager_job, ids)
     connection.close()