Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Django support for Alfajor
Python
branch: master

This branch is 40 commits ahead, 1 commit behind freyley:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
django_alfajor.egg-info
django_alfajor
docs
example_project
.gitignore
CHANGES
README
setup.py

README

= First, install alfajor and read the docs for it. = 

= In the project root, create a separate folder for alfajor tests =

jeff@snazz:~/projects/testproject$ mkdir functional

* then add this to functional/__init__.py :

from alfajor import WebBrowser
browser = WebBrowser()
browser.configure_in_scope('self-tests')

= django-nose =

Install django-nose. You'll need to change one line to make it work (until a patch is accepted):

--- a/django_nose/runner.py
+++ b/django_nose/runner.py
@@ -85,7 +85,7 @@ def _get_options():
     cfg_files = nose.core.all_config_files()
     manager = nose.core.DefaultPluginManager()
     config = nose.core.Config(env=os.environ, files=cfg_files, plugins=manager)
-    options = config.getParser().option_list
+    options = config.getParser()._get_all_options()
     django_opts = [opt.dest for opt in BaseCommand.option_list] + ['version']
     return tuple(o for o in options if o.dest not in django_opts and
                                        o.action != 'help')

= functional/alfajor.ini =

# Create an alfajor.ini, using the alfajor/tests/browser/alfajor.ini as 
# a template, then change the cmd line as seen below:

[self-tests+browser.selenium]
cmd = python manage.py testserver --addrport=8001
server_url = http://localhost:8001
ping-address = localhost:8001

= Running =

# start the selenium server
java -jar selenium-server.jar

# run the tests
./python manage.py test functional -- --browser=firefox

= Errata =

* Known bug: running functional tests also runs other tests
* It'd be nice to automatically start up selenium.
Something went wrong with that request. Please try again.