def test_with_bad_app(self):
        """Testing RenameField with application not in signature"""
        mutation = RenameField('TestModel', 'char_field1', 'char_field2')

        message = (
            'Cannot rename the field "char_field1" on model '
            '"badapp.TestModel". The application could not be found in the '
            'signature.')

        with self.assertRaisesMessage(SimulationFailure, message):
            mutation.run_simulation(app_label='badapp',
                                    project_sig=ProjectSignature(),
                                    database_state=None)
    def test_with_bad_app(self):
        """Testing RenameField with application not in signature"""
        mutation = RenameField('TestModel', 'char_field1', 'char_field2')

        message = (
            'Cannot rename the field "char_field1" on model '
            '"badapp.TestModel". The application could not be found in the '
            'signature.'
        )

        with self.assertRaisesMessage(SimulationFailure, message):
            mutation.run_simulation(app_label='badapp',
                                    project_sig=ProjectSignature(),
                                    database_state=None)
    def test_with_bad_model(self):
        """Testing RenameField with model not in signature"""
        mutation = RenameField('TestModel', 'char_field1', 'char_field2')

        project_sig = ProjectSignature()
        project_sig.add_app_sig(AppSignature(app_id='tests'))

        message = ('Cannot rename the field "char_field1" on model '
                   '"tests.TestModel". The model could not be found in the '
                   'signature.')

        with self.assertRaisesMessage(SimulationFailure, message):
            mutation.run_simulation(app_label='tests',
                                    project_sig=project_sig,
                                    database_state=None)
    def test_with_bad_model(self):
        """Testing RenameField with model not in signature"""
        mutation = RenameField('TestModel', 'char_field1', 'char_field2')

        project_sig = ProjectSignature()
        project_sig.add_app_sig(AppSignature(app_id='tests'))

        message = (
            'Cannot rename the field "char_field1" on model '
            '"tests.TestModel". The model could not be found in the '
            'signature.'
        )

        with self.assertRaisesMessage(SimulationFailure, message):
            mutation.run_simulation(app_label='tests',
                                    project_sig=project_sig,
                                    database_state=None)