def handle(self, *args, **options):
     errors = check_paired_models() + check_membership_elections_consistent(
     )
     if errors:
         for error in errors:
             print(error)
         sys.exit(1)
Esempio n. 2
0
 def test_base_with_no_extra_detected(self):
     unpaired_post = Post.objects.create(organization=self.commons)
     expected_errors = [
         'There were 6 Post objects, but 5 PostExtra objects',
         'The Post object with ID {} had no corresponding ' \
         'PostExtra object'.format(unpaired_post.id)
         ]
     self.assertEqual(check_paired_models(), expected_errors)
 def handle(self, *args, **options):
     errors = check_paired_models()
     if errors:
         for error in errors:
             print(error)
         sys.exit(1)
Esempio n. 4
0
 def test_no_problems_normally(self):
     errors = check_paired_models()
     for e in errors:
         print(e)
     self.assertEqual(0, len(errors))