Fixed #26342 -- Prevented unpacking when repr a NodeNotFoundError
This commit is contained in:
parent
ddf4af885f
commit
34c56687ae
|
@ -53,7 +53,7 @@ class NodeNotFoundError(LookupError):
|
||||||
return self.message
|
return self.message
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "NodeNotFoundError(%r)" % self.node
|
return "NodeNotFoundError(%r)" % (self.node, )
|
||||||
|
|
||||||
|
|
||||||
class MigrationSchemaMissing(DatabaseError):
|
class MigrationSchemaMissing(DatabaseError):
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
from django.db.migrations.exceptions import NodeNotFoundError
|
||||||
|
from django.test import SimpleTestCase
|
||||||
|
|
||||||
|
|
||||||
|
class ExceptionTests(SimpleTestCase):
|
||||||
|
def test_node_not_found_error_repr(self):
|
||||||
|
node = ('some_app_label', 'some_migration_label')
|
||||||
|
error_repr = repr(NodeNotFoundError('some message', node))
|
||||||
|
self.assertEqual(
|
||||||
|
error_repr,
|
||||||
|
"NodeNotFoundError(('some_app_label', 'some_migration_label'))"
|
||||||
|
)
|
Loading…
Reference in New Issue