Exemplo n.º 1
0
def test_system_organizations(client, web2py):
    """
        Is the list of organizations working?
    """
    populate_sys_organizations(web2py)

    url = '/settings/system_organizations'
    client.get(url)
    assert client.status == 200

    so = web2py.db.sys_organizations(1)
    assert so.Name in client.text
def test_reports_attendance_organizations_res_prices(client, web2py):
    """
        Is the page to list organizations with resolve prices showing?
    """
    populate_sys_organizations(web2py)

    url = '/reports/attendance_organizations_res_prices'
    client.get(url)
    assert client.status == 200

    so = web2py.db.sys_organizations(1)
    assert so.Name in client.text
def test_school_classcards_show_organization(client, web2py):
    """
        Is the organization column showing when we have more than 1 organization
    """
    populate_sys_organizations(web2py, 3)
    populate_school_classcards(web2py, 5)

    url = '/school_properties/classcards'
    client.get(url)
    assert client.status == 200

    assert 'Organization' in client.text
def test_reports_attendance_organizations_res_price_edit(client, web2py):
    """
        Is the page to edit resolve prices for an organization showing?
    """
    populate_sys_organizations(web2py)

    url = '/reports/attendance_organizations_res_price_edit?soID=1'
    client.get(url)
    assert client.status == 200

    data = {'id': '1', 'ReportsClassPrice': '123456'}

    client.post(url, data=data)
    assert client.status == 200
    assert data['ReportsClassPrice'] in client.text
def test_user_register_log_acceptance_documents(client, web2py):
    """
        Is acceptance of terms and conditions logged like it should?
    """
    populate_sys_organizations(web2py)

    url = '/default/user/register'
    client.get(url)
    assert client.status == 200

    data = {
        'first_name': 'openstudio',
        'last_name': 'user',
        'email': '*****@*****.**',
        'password': '******',
        'password_two': 'V3rYStr0ng#',
    }

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

    version = web2py.db.sys_properties(Property='Version').PropertyValue
    release = web2py.db.sys_properties(Property='VersionRelease').PropertyValue
    os_version = ".".join([version, release])
    org = web2py.db.sys_organizations(1)
    log_tc = web2py.db.log_customers_accepted_documents(1)
    log_pp = web2py.db.log_customers_accepted_documents(2)
    log_td = web2py.db.log_customers_accepted_documents(3)

    # Check logging of terms and conditions
    assert log_tc.DocumentName == 'Terms and Conditions'
    assert log_tc.DocumentDescription == org.TermsConditionsURL
    assert log_tc.DocumentVersion == org.TermsConditionsVersion
    assert log_tc.DocumentURL == 'http://localhost:8001/user/register'
    assert log_tc.OpenStudioVersion == os_version

    # Check logging of privacy notice
    assert log_pp.DocumentName == 'Privacy Notice'
    assert log_pp.DocumentDescription == org.PrivacyNoticeURL
    assert log_pp.DocumentVersion == org.PrivacyNoticeVersion
    assert log_pp.DocumentURL == 'http://localhost:8001/user/register'
    assert log_pp.OpenStudioVersion == os_version

    # Check logging of true and complete data acceptance
    assert log_td.DocumentName == 'Registration form'
    assert log_td.DocumentDescription == 'True and complete data'
    assert log_td.DocumentURL == 'http://localhost:8001/user/register'
    assert log_td.OpenStudioVersion == os_version
Exemplo n.º 6
0
def test_system_organization_edit(client, web2py):
    """
        Can we edit an organization?
    """
    populate_sys_organizations(web2py)

    url = '/settings/system_organization_edit?soID=1'
    client.get(url)
    assert client.status == 200

    data = {
        'id': '1',
        'Name': 'Edit organization',
        'Address': 'Address',
        'Phone': '0612345678',
        'Email': '*****@*****.**',
        'Registration': 'reg',
        'TaxRegistration': 'taxreg',
        'TermsConditionsURL': 'http://www.google.nl'
    }

    client.post(url, data=data)
    assert client.status == 200
    assert data['Name'] in client.text