          with captured_stderr() as stderr, self.assertRaises(SystemExit):
              management.ManagementUtility(['manage.py', 'dance', '--example=raise']).execute()
          self.assertIn("CommandError", stderr.getvalue())
  
      def test_default_en_us_locale_set(self):
          # Forces en_us when set to true
          out = StringIO()
          with translation.override('pl'):
              management.call_command('leave_locale_alone_false', stdout=out)
              # get_language returns settings.LANGUAGE_CODE for NullTranslations instances
              self.assertEqual(out.getvalue(), "%s\n" % settings.LANGUAGE_CODE)
 
</s> remove             # get_language returns settings.LANGUAGE_CODE for NullTranslations instances
            self.assertEqual(out.getvalue(), "%s\n" % settings.LANGUAGE_CODE)
 </s> add             self.assertEqual(out.getvalue(), "") </s> remove             self.assertEqual(get_language(), settings.LANGUAGE_CODE)
 </s> add             self.assertEqual(get_language(), None) </s> remove                 self.assertEqual(get_language(), settings.LANGUAGE_CODE)
 </s> add                 self.assertEqual(get_language(), None) </s> remove from django.conf import settings
 </s> add 
    def test_deactivate_locale_set(self):
        # Deactivate translation when set to true
          with captured_stderr() as stderr, self.assertRaises(SystemExit):
              management.ManagementUtility(['manage.py', 'dance', '--example=raise']).execute()
          self.assertIn("CommandError", stderr.getvalue())
  
    def test_deactivate_locale_set(self):
        # Deactivate translation when set to true
    def test_deactivate_locale_set(self):
        # Deactivate translation when set to true
          out = StringIO()
          with translation.override('pl'):
              management.call_command('leave_locale_alone_false', stdout=out)
              # get_language returns settings.LANGUAGE_CODE for NullTranslations instances
              self.assertEqual(out.getvalue(), "%s\n" % settings.LANGUAGE_CODE)
keep keep keep keep replace replace keep keep keep keep keep
 Fixed #24073 -- Returned None for get_language when translations are deactivated

This fixes a regression caused by f7c287fca9. Thanks Markus Holtermann
for identifying the regression. 
tests/user_commands/tests.py