|
@@ 100-128 (lines=29) @@
|
| 97 |
|
client.logout() |
| 98 |
|
|
| 99 |
|
|
| 100 |
|
def test_workshop_pages(client, settings): |
| 101 |
|
settings.SITE_VARIABLES['site_name'] = 'My Test Website' |
| 102 |
|
f.create_usertype(slug='tutor', display_name='tutor') |
| 103 |
|
poc_user = f.UserFactory(is_staff=False) |
| 104 |
|
poc_type = f.create_usertype(slug='poc', display_name='poc') |
| 105 |
|
poc_user.profile.usertype.add(poc_type) |
| 106 |
|
org = f.create_organisation() |
| 107 |
|
org.user.add(poc_user) |
| 108 |
|
org.save() |
| 109 |
|
poc_user.profile.location = org.location |
| 110 |
|
poc_user.profile.save() |
| 111 |
|
workshop = f.create_workshop(requester=org) |
| 112 |
|
workshop.presenter.add(poc_user) |
| 113 |
|
workshop.save() |
| 114 |
|
|
| 115 |
|
url_list = [ |
| 116 |
|
'/workshop/', |
| 117 |
|
'/workshop/create/', |
| 118 |
|
'/workshop/{}/'.format(workshop.id), |
| 119 |
|
] |
| 120 |
|
|
| 121 |
|
for page_url in url_list: |
| 122 |
|
client.login(poc_user) |
| 123 |
|
response = client.get(page_url) |
| 124 |
|
assert response.status_code == 200, 'Failed for %s' % page_url |
| 125 |
|
assert poc_user.get_full_name() in str(response.content) |
| 126 |
|
assert settings.SITE_VARIABLES[ |
| 127 |
|
'site_name'] in str(response.content) |
| 128 |
|
client.logout() |
| 129 |
|
|
|
@@ 70-97 (lines=28) @@
|
| 67 |
|
client.logout() |
| 68 |
|
|
| 69 |
|
|
| 70 |
|
def test_orgnisation_pages(client, settings): |
| 71 |
|
f.create_usertype(slug='tutor', display_name='tutor') |
| 72 |
|
settings.SITE_VARIABLES['site_name'] = 'My Test Website' |
| 73 |
|
normal_user = f.UserFactory(is_staff=False) |
| 74 |
|
|
| 75 |
|
poc_type = f.create_usertype(slug='poc', display_name='poc') |
| 76 |
|
normal_user.profile.usertype.add(poc_type) |
| 77 |
|
org = f.create_organisation() |
| 78 |
|
org.user.add(normal_user) |
| 79 |
|
org.save() |
| 80 |
|
normal_user.profile.location = org.location |
| 81 |
|
normal_user.profile.save() |
| 82 |
|
|
| 83 |
|
url_list = [ |
| 84 |
|
'/organisation/', |
| 85 |
|
'/organisation/create/', |
| 86 |
|
'/organisation/{}/'.format(org.id), |
| 87 |
|
'/organisation/{}/edit/'.format(org.id), |
| 88 |
|
] |
| 89 |
|
|
| 90 |
|
for page_url in url_list: |
| 91 |
|
client.login(normal_user) |
| 92 |
|
response = client.get(page_url) |
| 93 |
|
assert response.status_code == 200, 'Failed for %s' % page_url |
| 94 |
|
assert normal_user.get_full_name() in str(response.content) |
| 95 |
|
assert settings.SITE_VARIABLES[ |
| 96 |
|
'site_name'] in str(response.content) |
| 97 |
|
client.logout() |
| 98 |
|
|
| 99 |
|
|
| 100 |
|
def test_workshop_pages(client, settings): |