#21075: django crashes with sys.exit(1) when management.call_command is used 
with
unittest
-------------------------------------+-------------------------------------
     Reporter:  nahumoz@…            |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Core                 |                  Version:  1.5
  (Serialization)                    |               Resolution:  invalid
     Severity:  Normal               |             Triage Stage:
     Keywords:                       |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by bmispelon):

 * cc: bmispelon@… (added)
 * status:  new => closed
 * resolution:   => invalid


Comment:

 I had a look at the documentation for `call_command` [1] and figured out
 what was wrong.

 You're not supposed to pass options like `-e` as positional arguments but
 as named arguments instead, like so:
 {{{
 call_command('dumpdata', 'TimePortal', exclude='contenttypes', indent=4,
 stdout=j)
 }}}


 I agree that the error message is not completely clear (though it does
 tell you that the command is trying to interpret "-e" as an application
 name), but I think the documentation is helpful and the examples are
 pretty straightforward.


 [1] https://docs.djangoproject.com/en/1.5/ref/django-
 admin/#django.core.management.call_command

-- 
Ticket URL: <https://code.djangoproject.com/ticket/21075#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/075.d599a4fecbb04024fa0feaef987c8a86%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to