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

Ticket #19125 #441

Closed
wants to merge 1 commit into from
Closed

Ticket #19125 #441

wants to merge 1 commit into from

Conversation

lqc
Copy link

@lqc lqc commented Oct 13, 2012

@lqc
Copy link
Author

lqc commented Oct 13, 2012

Sorry about the earlier version, I first didn't noticed there are already tests for startproject and then forgot to remove the duplicates. Ironicly, the diff on the ticket didn't have them so I didn't noticed.

out, err = self.run_django_admin(args)
self.assertOutput(err, "Error: '../testproject' is not a valid project name. Please make sure the name begins with a letter or underscore.")
self.assertFalse(os.path.exists(testproject_dir))

def test_simple_project_different_directory(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicking: I would have reused the test_invalid_project_name test, looping on "for project_name in ('7testproject', '../testproject'):". This would allow us to test more names with less code duplication.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a lot more code duplication in that TestCase then that ;)

The isolation is also poor, because it modifies Django source tree, so this won't work in parallel and won't cleanup if startproject actually makes a directory, but with malformed name. I started refactoring it, but that would make the patch quite a huge change for this ticket. I can still do it, though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's how I would have written it: https://gist.github.com/3911240. Hopefully it's not worse than the previous version.

@claudep
Copy link
Member

claudep commented Jan 24, 2013

Thanks for the patch, committed in 9893fa1

@claudep claudep closed this Jan 24, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants