-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
50 lines (35 loc) · 1.54 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
= 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.