예제 #1
0
def test_shop_customers_profile_announcements(client, web2py):
    """
        Is the shop profile announcements page working?
    """
    populate_settings_shop_customers_profile_announcements(web2py)

    url = '/settings/shop_customers_profile_announcements'
    client.get(url)
    assert client.status == 200
예제 #2
0
def test_index_announcements(client, web2py):
    """
        Are the announcements shown correctly?
    """
    setup_profile_tests(web2py)
    populate_settings_shop_customers_profile_announcements(web2py)

    url = '/profile/index'
    client.get(url)
    assert client.status == 200

    cpa = web2py.db.customers_profile_announcements(1)
    assert cpa.Title in client.text
    assert cpa.Announcement in client.text
예제 #3
0
def test_shop_customers_profile_announcement_edit(client, web2py):
    """
        Can we edit a link?
    """
    populate_settings_shop_customers_profile_announcements(web2py)

    url = '/settings/shop_customers_profile_announcement_edit?cpaID=1'
    client.get(url)
    assert client.status == 200

    data = {
        'id': 1,
        'PublicAnnouncement': 'on',
        'Title': 'OMGubuntu',
        'Announcement': 'http://www.omgubuntu.co.uk/'
    }

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

    assert data['Title'] in client.text