On 12/07/2014 12:59 PM, Matwey V. Kornilov wrote:
> The following code works perfect for me, why the code in the
> documentations so sophisticated?
> 
> def runtests():
>         os.environ.setdefault("DJANGO_SETTINGS_MODULE",
> "tests.test_settings")
> 
>         try:
>                 from django import setup
>                 setup()
>         except ImportError:
>                 pass
>         from django.core.management import call_command
> 
>         call_command("test","tests.__init__")
> 
> if __name__ == "__main__":
>         runtests()

Sure, that works too. I don't think it's significantly simpler than the
documented version, and it's less flexible if you want to customize test
running further.

Carl

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5484C772.5040505%40oddbird.net.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to