Skip to content

Commit f040b3a

Browse files
committed
require python >=3.11 plus a few test fixes
1 parent 415dbad commit f040b3a

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

.github/workflows/django.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
max-parallel: 4
1515
matrix:
16-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
16+
python-version: ["3.11", "3.12"]
1717
services:
1818
# Label used to access the service container
1919
postgres:
@@ -56,8 +56,8 @@ jobs:
5656
ROUNDWARE_DB_HOST: postgres
5757
ROUNDWARE_DB_PORT: ${{ job.services.postgres.ports[5432] }}
5858
run: |
59-
coverage run --source=roundware roundware/manage.py test --settings=roundware.settings.testing
60-
coverage report -m > coverage-report.txt
59+
.venv/bin/coverage run --source=roundware roundware/manage.py test --settings=roundware.settings.testing
60+
.venv/bin/coverage report -m > coverage-report.txt
6161
cat coverage-report.txt
6262
# - uses: actions/upload-artifact@v2
6363
# with:

roundware/api2/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def sessions_post(self):
214214
url = reverse('session-list')
215215
# first pass no geo_listen_enabled
216216
data = {"timezone": "-0500",
217-
"project_id": 1,
217+
"project_id": self.project1.id,
218218
"client_system": "iOS"}
219219
response = self.client.post(url, data, format='json')
220220
self.assertEqual(response.status_code, status.HTTP_200_OK)

roundware/api2/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,8 @@ def create(self, request):
11941194
# rather than requiring multipart/form-data
11951195
rdm = request.data.copy()
11961196
if 'geo_listen_enabled' not in rdm:
1197-
p = Project.objects.get(id=rdm['project'])
1197+
project_id = rdm.get('project_id') or rdm.get('project')
1198+
p = Project.objects.get(id=project_id)
11981199
rdm['geo_listen_enabled'] = p.geo_listen_enabled
11991200
logger.info('geo_listen_enabled not passed! set to project value: %s' % rdm['geo_listen_enabled'])
12001201
serializer = serializers.SessionSerializer(data=rdm, context={'request': request})

0 commit comments

Comments
 (0)