Exemple #1
0
 def test_purges(self):
     self.assertTrue(Program.objects.exists())
     self.assertTrue(Notification.objects.exists())
     self.assertTrue(
         purge_objects.purge('schools') == purge_objects.error_msg)
     self.assertTrue(purge_objects.purge('') == purge_objects.no_args_msg)
     self.assertIn("test-programs", purge_objects.purge('test-programs'))
     self.assertTrue(Program.objects.exists())
     self.assertIn("programs", purge_objects.purge('programs'))
     self.assertFalse(Program.objects.exists())
     self.assertIn("notifications", purge_objects.purge('notifications'))
     self.assertFalse(Notification.objects.exists())
Exemple #2
0
 def test_purges(self):
     self.assertTrue(Program.objects.exists())
     self.assertTrue(Notification.objects.exists())
     self.assertTrue(purge_objects.purge('schools') ==
                     purge_objects.error_msg)
     self.assertTrue(purge_objects.purge('') ==
                     purge_objects.no_args_msg)
     self.assertIn("test-programs", purge_objects.purge('test-programs'))
     self.assertTrue(Program.objects.exists())
     self.assertIn("programs", purge_objects.purge('programs'))
     self.assertFalse(Program.objects.exists())
     self.assertIn("notifications", purge_objects.purge('notifications'))
     self.assertFalse(Notification.objects.exists())
Exemple #3
0
 def handle(self, *args, **options):
     msg = purge(options['objects'])
     self.stdout.write(msg)