Exemplo n.º 1
0
 def test_organization_stop_jobs(self):
     config = TestConfiguration()
     other_org = Organization.objects.create(name="Other Org")
     other_rg = RecordGroup.objects.create(organization=other_org,
                                           name="Other Record Group")
     Job.objects.create(record_group=other_rg,
                        user=config.user,
                        job_type='MergeJob',
                        job_details='{"test_key": "test value"}',
                        name="Other Job")
     response = self.client.get(
         reverse('organization_stop_jobs', args=[config.org.id]))
     self.assertRedirects(response, reverse('organizations'))
     gm = most_recent_global_message()
     self.assertEqual(
         gm['html'],
         '<p><strong>Stopped Job(s):</strong><br>Test Job<br>Test Transform Job</p>'
     )
     self.assertEqual(gm['class'], 'danger')
Exemplo n.º 2
0
 def test_record_group_run_jobs(self):
     other_rg = RecordGroup.objects.create(organization=self.config.org,
                                           name="Other Record Group")
     Job.objects.create(record_group=other_rg,
                        user=self.config.user,
                        job_type='MergeJob',
                        job_details='{"test_key": "test value"}',
                        name="Other Job")
     response = self.client.get(
         reverse('record_group_run_jobs',
                 args=[self.config.org.id, self.config.record_group.id]))
     self.assertRedirects(
         response, reverse('organization', args=[self.config.org.id]))
     gm = most_recent_global_message()
     self.assertEqual(
         gm['html'],
         '<strong>Preparing to Rerun Job(s):</strong><br>Test Job<br>Test Transform Job'
     )
     self.assertEqual(gm['class'], 'success')