          SESSION_FILE_PATH="/if/this/directory/exists/you/have/a/weird/computer")
      def test_configuration_check(self):
          del self.backend._storage_path
          # Make sure the file backend checks for a good storage dir
          self.assertRaises(ImproperlyConfigured, self.backend)
  
      def test_invalid_key_backslash(self):
          # Ensure we don't allow directory-traversal.
          # This is tested directly on _key_to_file, as load() will swallow
          # a SuspiciousOperation in the same way as an IOError - by creating
 
</s> remove         self.assertRaises(InvalidSessionKey,
                          self.backend()._key_to_file, "a\\b\\c")
 </s> add         with self.assertRaises(InvalidSessionKey):
            self.backend()._key_to_file("a\\b\\c") </s> remove         self.assertRaises(ValueError, Author.objects.annotate, friends=Count('friends'))
 </s> add         with self.assertRaises(ValueError):
            Author.objects.annotate(friends=Count('friends')) </s> remove         self.assertRaises(InvalidSessionKey,
                          self.backend()._key_to_file, "a/b/c")
 </s> add         with self.assertRaises(InvalidSessionKey):
            self.backend()._key_to_file("a/b/c") </s> remove         self.assertRaises(DatabaseError, self.column_classes, new_field.remote_field.through)
 </s> add         with self.assertRaises(DatabaseError):
            self.column_classes(new_field.remote_field.through) </s> remove         self.assertRaises(KeyError, self.client.get, "/broken_view/")
 </s> add         with self.assertRaises(KeyError):
            self.client.get("/broken_view/")
        with self.assertRaises(ImproperlyConfigured):
            self.backend()
          SESSION_FILE_PATH="/if/this/directory/exists/you/have/a/weird/computer")
      def test_configuration_check(self):
          del self.backend._storage_path
          # Make sure the file backend checks for a good storage dir
        with self.assertRaises(ImproperlyConfigured):
            self.backend()
  
      def test_invalid_key_backslash(self):
          # Ensure we don't allow directory-traversal.
          # This is tested directly on _key_to_file, as load() will swallow
          # a SuspiciousOperation in the same way as an IOError - by creating
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/sessions_tests/tests.py