Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

Commit

Permalink
Test skip class payment for karma role
Browse files Browse the repository at this point in the history
  • Loading branch information
edwinvandeven committed Jun 29, 2020
1 parent eedf19e commit 3a9aaf9
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/controllers/test_13_finance_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,30 @@ def test_teacher_payment_find_classes_fixed_rate_default(client, web2py):
assert tpc.tax_rates_id == default_rate.tax_rates_id


def test_teacher_payment_find_classes_fixed_rate_default_skip_karma_role_teacher1(client, web2py):
"""
Is the fixed rate applied when finding classes?
"""
prepare_classes(web2py)
populate_auth_user_teachers_fixed_rate_default(web2py)
web2py.db(web2py.db.classes_teachers.auth_teacher_id == 2).update(teacher_role=3)
web2py.db.commit()

url = '/finance/teacher_payment_find_classes'
client.get(url)
assert client.status == 200

data = {
'Startdate': '2014-01-01',
'Enddate': '2014-01-31'
}

client.post(url, data=data)
assert client.status == 200

query = (web2py.db.teachers_payment_classes.auth_teacher_id == 2)
assert web2py.db(query).count() == 0


def test_teacher_payment_find_classes_travel_allowance(client, web2py):
"""
Expand Down

0 comments on commit 3a9aaf9

Please sign in to comment.