New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed #23341 -- Better stacktrace error for makemigrations #3100
Conversation
Could you add tests for this? It seems these errors currently aren't covered: http://djangoci.com/job/django-coverage/HTML_Coverage_Report/_home_jenkins_workspace_django-coverage_django_db_migrations_graph.html#n38 |
if child not in self.nodes: | ||
raise KeyError("Dependency references nonexistent child node %r" % (child,)) | ||
raise KeyError("In migration %s dependency references nonexistent child node %r" % (migration, child,)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no longer need trailing comma in tuple here and below
I'd chop "In" from the message, otherwise it looks good.
5862ef9
to
317269b
Compare
Updated PR with tests for add_dependency. |
graph.add_node(("app_b", "0001"), None) | ||
graph.add_dependency("app_a.0003", ("app_a", "0003"), ("app_a", "0002")) | ||
graph.add_dependency("app_a.0002", ("app_a", "0002"), ("app_a", "0001")) | ||
with self.assertRaises(KeyError) as ex: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assertRaisesMessage (and then can also remove as ex
)
Show the migration display name when references nonexistent migration(s)
317269b
to
474e1c7
Compare
Updated PR |
buildbot, test this please. |
merged in abd640f, thanks. |
Show the migration display name when references
nonexistent migration(s)
Refs https://code.djangoproject.com/ticket/23341