Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

rsalmaso
Copy link
Contributor

Show the migration display name when references
nonexistent migration(s)

Refs https://code.djangoproject.com/ticket/23341

@timgraham
Copy link
Member

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,))
Copy link
Member

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.

@rsalmaso
Copy link
Contributor Author

Updated PR with tests for add_dependency.
For the other tests (backwards_plan and forwards_plan) I'll open a new ticket (
https://code.djangoproject.com/ticket/23352 and PR #3106 and #3107)

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:
Copy link
Member

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)
@rsalmaso
Copy link
Contributor Author

Updated PR
Need to update #3101 ?

@timgraham
Copy link
Member

buildbot, test this please.

@timgraham
Copy link
Member

merged in abd640f, thanks.

@timgraham timgraham closed this Aug 23, 2014
@rsalmaso rsalmaso deleted the tickets/23341 branch August 24, 2014 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants