コード例 #1
0
    def test_with_bad_app(self):
        """Testing DeleteField with application not in signature"""
        mutation = DeleteField('TestModel', 'char_field1')

        message = (
            'Cannot delete 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)
コード例 #2
0
    def test_with_bad_app(self):
        """Testing DeleteField with application not in signature"""
        mutation = DeleteField('TestModel', 'char_field1')

        message = (
            'Cannot delete 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)
コード例 #3
0
    def test_with_bad_model(self):
        """Testing DeleteField with model not in signature"""
        mutation = DeleteField('TestModel', 'char_field1')

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

        message = ('Cannot delete 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)
コード例 #4
0
    def test_with_bad_model(self):
        """Testing DeleteField with model not in signature"""
        mutation = DeleteField('TestModel', 'char_field1')

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

        message = (
            'Cannot delete 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)