Skip to content

Commit

Permalink
Merge pull request #164 from Teknologforeningen/feature/github-action
Browse files Browse the repository at this point in the history
Create django-test.yml Github Actions workflow for automatically running tests on PRs.
  • Loading branch information
filiptypjeu authored Aug 6, 2023
2 parents 3eec121 + 0b5d222 commit cc0c597
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/django-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: teknologr.io unittests

on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10.12"
- name: Install latest pip
run: python -m pip install --upgrade pip
- name: Install dependencies
run: |
sudo apt install libsasl2-dev python3-dev libldap2-dev libssl-dev
sudo locale-gen sv_FI.UTF-8
sudo update-locale
pip install -r requirements.txt
- name: Apply migrations
run: python teknologr/manage.py migrate
- name: Run tests
run: python teknologr/manage.py test teknologr
3 changes: 0 additions & 3 deletions teknologr/members/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ def get_functionarytype_choices():

functionarytype = ChoiceField(choices=get_functionarytype_choices)


def __init__(self, *args, **kwargs):
# Make sure automatic dom element ids are different from other forms'
kwargs.setdefault('auto_id', 'fform_%s')
Expand Down Expand Up @@ -124,7 +123,6 @@ def get_decoration_choices():

decoration = ChoiceField(choices=get_decoration_choices)


def __init__(self, *args, **kwargs):
# Make sure automatic dom element ids are different from other forms'
kwargs.setdefault('auto_id', 'doform_%s')
Expand Down Expand Up @@ -156,7 +154,6 @@ def get_grouptype_choices():

grouptype = ChoiceField(choices=get_grouptype_choices)


def __init__(self, *args, **kwargs):
# Make sure automatic dom element ids are different from other forms'
kwargs.setdefault('auto_id', 'gform_%s')
Expand Down

0 comments on commit cc0c597

Please sign in to comment.