def test_first_case(self):
    with patch('config.MY_CONFIG_VARIABLE', True):
        self.assertEqual(my_function_with_global_var(), 'First result')
Modifying global variables in Python unittest framework