File tree 4 files changed +52
-0
lines changed
4 files changed +52
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,10 @@ libraries.
150
150
Use a code editor that integrates with editorconfig and flake8. I also recommend
151
151
autopep8 for automatically formatting code to follow the PEP8 guidelines.
152
152
153
+ ### Running Django Tests
154
+
155
+ Run `./runtests.py` to run the Django unit tests.
156
+
153
157
## License
154
158
155
159
The Apache Airavata Django Portal is licensed under the Apache 2.0 license. For
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python
2
+ # This script based on
3
+ # https://docs.djangoproject.com/en/1.11/topics/testing/advanced/#using-the-django-test-runner-to-test-reusable-applications
4
+ import os
5
+ import sys
6
+
7
+ import django
8
+ from django .conf import settings
9
+ from django .test .utils import get_runner
10
+
11
+ if __name__ == "__main__" :
12
+ os .environ ['DJANGO_SETTINGS_MODULE' ] = 'tests.settings'
13
+ django .setup ()
14
+ TestRunner = get_runner (settings )
15
+ test_runner = TestRunner ()
16
+ # Pass None for test_labels to have the runner discover all tests under
17
+ # this directory
18
+ failures = test_runner .run_tests (None )
19
+ sys .exit (bool (failures ))
Original file line number Diff line number Diff line change
1
+ import os
2
+
3
+ # Import the common settings, can override them below as needed
4
+ from django_airavata .settings import *
5
+
6
+ BASEDIR = os .path .dirname (os .path .dirname (os .path .abspath (__file__ )))
7
+
8
+ # Use a SQLite database for testing
9
+ DATABASES = {
10
+ 'default' : {
11
+ 'ENGINE' : 'django.db.backends.sqlite3' ,
12
+ 'NAME' : os .path .join (BASEDIR , 'db.sqlite3' ),
13
+ }
14
+ }
15
+
16
+ # Settings that are expected to be defined in settings_local.py
17
+ AIRAVATA_API_HOST = 'localhost'
18
+ AIRAVATA_API_PORT = 8930
19
+ AIRAVATA_API_SECURE = False
20
+
21
+ PROFILE_SERVICE_HOST = AIRAVATA_API_HOST
22
+ PROFILE_SERVICE_PORT = 8962
23
+ PROFILE_SERVICE_SECURE = False
24
+
25
+ SHARING_API_HOST = AIRAVATA_API_HOST
26
+ SHARING_API_PORT = 7878
27
+ SHARING_API_SECURE = False
28
+
29
+ PORTAL_TITLE = 'Django Airavata Gateway'
You can’t perform that action at this time.
0 commit comments