Support Questions
Find answers, ask questions, and share your expertise

running django tests for custom hue app

Solved Go to solution

running django tests for custom hue app

Explorer

Is it possible to use the django testing framework to test a custom hue app build with the hue SDK? When I try to use the manage.py that is part of my app, I get 

django.core.exceptions.ImproperlyConfigured

 errors, related to my settings.py module. But I can't seem to find a different entrypoint to try running the tests. What's the workflow for writing and running django tests for a custom hue app?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: running django tests for custom hue app

Explorer

ended up just running 

hue/build/env/bin/pip install windmill

 and then 

hue/build/env/bin/hue test specific myapp.tests

 worked just fine. Seems weird that that dependency wouldn't have installed itself during `make apps`.

Anyhow, thanks for your help.

View solution in original post

4 REPLIES 4

Re: running django tests for custom hue app

The scenario is the same as
http://gethue.com/tutorial-how-to-run-the-hue-integration-tests/, did you
do 'test specific your_app'?

Romain

Re: running django tests for custom hue app

Explorer

Hi, thanks for your response.

 

I'd tried using the build/enve/bin/hue executable as well, but got the below stack trace. I'd just assumed that I was using it impropperly. Any idea why it would complain about missing windmill.authoring?

 

$ ./BUILD/hue/build/env/bin/hue test specific myapp.tests
Traceback (most recent call last):
  File "./BUILD/hue/build/env/bin/hue", line 8, in <module>
    load_entry_point('desktop==3.6.0', 'console_scripts', 'hue')()
  File "/Users/sstory/Desktop/Dev/Stash/synthesys-cloud/BUILD/hue/desktop/core/src/desktop/manage_entry.py", line 60, in entry
    execute_manager(settings)
  File "/Users/sstory/Desktop/Dev/Stash/synthesys-cloud/BUILD/hue/build/env/lib/python2.7/site-packages/Django-1.4.5-py2.7.egg/django/core/management/__init__.py", line 459, in execute_manager
    utility.execute()
  File "/Users/sstory/Desktop/Dev/Stash/synthesys-cloud/BUILD/hue/build/env/lib/python2.7/site-packages/Django-1.4.5-py2.7.egg/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/sstory/Desktop/Dev/Stash/synthesys-cloud/BUILD/hue/build/env/lib/python2.7/site-packages/Django-1.4.5-py2.7.egg/django/core/management/__init__.py", line 261, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/Users/sstory/Desktop/Dev/Stash/synthesys-cloud/BUILD/hue/build/env/lib/python2.7/site-packages/Django-1.4.5-py2.7.egg/django/core/management/__init__.py", line 69, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/Users/sstory/Desktop/Dev/Stash/synthesys-cloud/BUILD/hue/build/env/lib/python2.7/site-packages/Django-1.4.5-py2.7.egg/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/Users/sstory/Desktop/Dev/Stash/synthesys-cloud/BUILD/hue/desktop/core/src/desktop/management/commands/test.py", line 35, in <module>
    from desktop.management.commands import test_windmill
  File "/Users/sstory/Desktop/Dev/Stash/synthesys-cloud/BUILD/hue/desktop/core/src/desktop/management/commands/test_windmill.py", line 26, in <module>
    from windmill.authoring import djangotest
ImportError: No module named windmill.authoring

 

Re: running django tests for custom hue app

Explorer

ended up just running 

hue/build/env/bin/pip install windmill

 and then 

hue/build/env/bin/hue test specific myapp.tests

 worked just fine. Seems weird that that dependency wouldn't have installed itself during `make apps`.

Anyhow, thanks for your help.

View solution in original post

Re: running django tests for custom hue app

Great!

Weird indeed, make apps pulls dynamically some packages, maybe the repos
were down at the time.

Romain