Created
December 2, 2014 22:08
-
-
Save rpq/5655d2cfa7ab6b6c431b to your computer and use it in GitHub Desktop.
test the django management command snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 fixture = ("/Users/quezadar/projects/b2b-frontend/B2B/src/b2b/tests/" | |
107 "fixtures/initial_data.json") | |
108 cmd = 'manage.py loaddata \'%s\'' % (fixture,) | |
109 s = StringIO.StringIO() | |
110 sys_stdout = sys.stdout | |
111 sys_stderr = sys.stderr | |
112 sys.stdout = s | |
113 sys.stderr = s | |
114 execute_from_command_line(cmd.split(' ')) | |
115 sys.stdout = sys_stdout | |
116 sys.stderr = sys_stderr | |
117 print('done loading data') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment