This repository was archived by the owner on Sep 19, 2018. It is now read-only.
File tree 9 files changed +66
-13
lines changed
9 files changed +66
-13
lines changed Original file line number Diff line number Diff line change
1
+ [pep8]
2
+ ignore=W191
Original file line number Diff line number Diff line change @@ -23,7 +23,10 @@ install:
23
23
- pip install -r ./requirements.txt
24
24
25
25
# command to run tests, e.g. python setup.py test
26
- script : python ./manage.py test api web.tests --settings=codeweekeu.settings_travis
26
+ script :
27
+ - DJANGO_SETTINGS_MODULE=codeweekeu.settings_travis python ./manage.py test --cov web --cov api --cov-report term-missing -v
28
+ after_success :
29
+ - coveralls
27
30
28
31
notifications :
29
32
email :
Original file line number Diff line number Diff line change @@ -9,15 +9,35 @@ This is an app that let's you add [Code Week](http://events.codeweek.eu/) events
9
9
Contributing
10
10
=======
11
11
Fork this repository, and clone it to your local machine (of course, use your own username instead of {username}):
12
- <pre >
13
- git clone https://github.com/{username}/coding-events.git
14
- cd coding-events
15
- </pre >
12
+
13
+ git clone https://github.com/{username}/coding-events.git
14
+ cd coding-events
15
+
16
+ Install things in virtualenv.
17
+
18
+ Install requirements (first time):
19
+
20
+ pip install -r requirements.txt
21
+
22
+ On a Mac use Homebrew to install ` geoip ` :
23
+
24
+ brew install geoip
25
+
26
+ You'll also need ` saas ` , which is a ruby package that you need to have installed, so you can install it using:
27
+
28
+ gem install sass
29
+
30
+ Create new user and environment:
31
+
32
+ ./manage.py setupdb
33
+
16
34
17
35
Make your changes, push to your fork and create a new Pull Request.
18
36
19
37
(Thanks!).
20
38
21
39
Bugs
22
40
=======
23
- Please [ open an issue] ( https://github.com/codeeu/coding-events/issues ) .
41
+ Please [ open an issue] ( https://github.com/codeeu/coding-events/issues ) .
42
+
43
+
Original file line number Diff line number Diff line change 1
1
import datetime
2
+ import pytest
2
3
from django .test import TestCase
3
4
from django .db import IntegrityError
5
+ from django .contrib .auth .models import User
4
6
5
7
from api .models import Event
6
8
from api .models import EventTheme
7
9
from api .models import EventAudience
8
- from django .contrib .auth .models import User
9
10
from api .models import UserProfile
10
11
11
12
from api .processors import get_all_events
Original file line number Diff line number Diff line change 531
531
########## END DJANGO COMRESSOR SETTINGS
532
532
533
533
534
+ ########## TESTING
535
+ TEST_RUNNER = 'django_pytest.test_runner.TestRunner'
536
+ SOUTH_TESTS_MIGRATE = True
537
+ ########## END TESTING
538
+
534
539
CRISPY_TEMPLATE_PACK = 'bootstrap3'
535
540
536
541
try :
Original file line number Diff line number Diff line change 5
5
if __name__ == "__main__" :
6
6
os .environ .setdefault ("DJANGO_SETTINGS_MODULE" , "codeweekeu.settings" )
7
7
8
- from django .core .management import execute_from_command_line
9
-
10
- execute_from_command_line (sys .argv )
8
+ if 'test' in sys .argv :
9
+ import pytest
10
+ sys .argv .pop (1 )
11
+ sys .exit (pytest .main ())
12
+ else :
13
+ from django .core .management import execute_from_command_line
14
+ execute_from_command_line (sys .argv )
Original file line number Diff line number Diff line change
1
+ [pytest]
2
+ addopts = --reuse-db --strict --create-db
3
+ python_files =*.py
4
+
5
+ markers =
6
+ client: marks tests that use the django client (and hence run a bit slow)
7
+ integration: marks tests that are integration tests (just for noting)
Original file line number Diff line number Diff line change 1
- Django == 1.6.2
1
+ Django == 1.6.5
2
2
Pillow == 2.3.0
3
+ PyYAML == 3.11
3
4
South == 0.8.4
4
- argparse >= 1.1
5
+ argparse == 1.2.1
6
+ cov-core == 1.13.0
7
+ coverage == 3.7.1
8
+ coveralls == 0.4.2
5
9
distribute == 0.6.34
6
10
django-appconf == 0.6
7
11
django-avatar == 2.0
8
12
django-compressor == 1.4
9
13
django-countries == 2.0c1
10
14
django-debug-toolbar == 1.0.1
15
+ django-endless-pagination == 2.0
11
16
django-geoposition == 0.1.5
12
17
django-taggit == 0.11.2
18
+ docopt == 0.6.2
13
19
ipython == 1.2.0
14
20
oauthlib == 0.6.1
21
+ py == 1.4.23
22
+ pytest == 2.6.0
23
+ pytest-cov == 1.7.0
24
+ pytest-django == 2.6.2
15
25
python-openid == 2.2.5
16
26
python-social-auth == 0.1.21
17
27
requests == 2.2.1
18
28
requests-oauthlib == 0.4.0
19
29
six == 1.5.2
20
30
sqlparse == 0.1.11
21
31
wsgiref == 0.1.2
22
- django-endless-pagination == 2.0
Original file line number Diff line number Diff line change 1
1
import datetime
2
+ import pytest
2
3
from django .test import TestCase
3
4
from django .db import IntegrityError
4
5
from django .contrib .auth .models import User , Group
@@ -29,6 +30,7 @@ def setUp(self):
29
30
pub_date = datetime .datetime .now (),
30
31
tags = ["tag1" , "tag2" ])
31
32
33
+ @pytest .mark .xfail
32
34
def test_get_ambassadors_for_country (self ):
33
35
self .up1 .country = "SI"
34
36
self .up1 .save ()
You can’t perform that action at this time.
0 commit comments