If I could add, in my tests, I was testing to see whether the command
executed successfully and I was inspecting the state of the database
after the command executed.

On May 14, 3:04 pm, ses1984 <ses1...@gmail.com> wrote:
> I am interested in writing unit tests to cover some custom commands I
> have written, but I'm unsure how I can pass options to these commands
> through my unittest.TestCase classes.
>
> I have a command to import data from my client's flat file system into
> Django models, which originally existed as a NoArgsCommand with no
> options. I tested it like this:
>
> class ImportDataTest(unittest.TestCase):
>
>     def setUp(self):
>         test_command = import_flatfile_data.Command()
>         test_command.handle_noargs()
>
> I have added a boolean flag option to this command, so I would like to
> split this test case in two, where one case sets up the command as
> with the flag set to true, and one case where the flag is false.
>
> I tried looking for testing coverage of django's own management
> commands, but I was unable to find those.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to