Skip to content

Commit

Permalink
Debug this
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Aug 18, 2024
1 parent 73ee469 commit 60065dd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/testapp/test_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from django.db import connections, models
from django.db.models import Count, Q, Sum
from django.db.models.expressions import RawSQL
from django.db.utils import OperationalError
from django.test import TestCase, override_settings

from testapp.models import (
Expand Down Expand Up @@ -163,9 +162,12 @@ def test_update_aggregate(self):
def test_update_descendants(self):
"""UpdateQuery does not work with tree queries"""
tree = self.create_tree()
with self.assertRaises(OperationalError) as cm:
# OperationalError would probably be appropriate, but the psycopg2
# backend raises psycopg2.errors.UndefinedTable, which isn't an
# OperationalError subclass.
with self.assertRaises(Exception) as cm:
tree.root.descendants().update(name="test")
self.assertIn("__tree.tree_path", str(cm.exception))
self.assertIn("__tree", str(cm.exception))

def test_update_descendants_with_filter(self):
"""Updating works when using a filter"""
Expand Down

0 comments on commit 60065dd

Please sign in to comment.