Skip to content

Commit

Permalink
Test got replaced.
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrillkuettel committed Nov 26, 2024
1 parent 765499d commit ea171ca
Showing 1 changed file with 0 additions and 55 deletions.
55 changes: 0 additions & 55 deletions tests/onegov/town6/test_views_topics.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,58 +151,3 @@ def test_view_page_as_member(client):
page = anon.get('/topics/organisation')
assert 'Test' not in page


def test_inline_photo_album(client):
admin = client
client.login_admin()
# create an imageset first
albums = client.get('/photoalbums')
new = albums.click('Fotoalbum')
new.form['title'] = 'Comicon 2016'
new.form.submit()

albums = client.get('/photoalbums')
assert 'Comicon 2016' in albums

album = albums.click('Comicon 2016')
assert 'Comicon 2016' in album
assert 'noch keine Bilder' in album

images = albums.click('Bilder verwalten')
images.form['file'] = Upload('test.jpg', create_image().read())
images.form.submit()

select = album.click("Bilder auswählen")
select.form[tuple(select.form.fields.keys())[1]] = True
select.form.submit()

# now select the album in the topic
new_page = admin.get('/topics/organisation').click('Thema')
new_page.form['title'] = 'Test'
new_page.form['access'] = 'member'

try:
new_page.form['photo_album_id'] = 'Comicon 2016'
# this fails. why?
except Exception:
pass

# For some weird reason, the select field is not parsed to form.fields?
# But it's there in the form if you go check the html.
# We have to do manual hokey pokey to get the album id

# Find album id from select options
select = new_page.pyquery('#photo_album_id')[0]
album_id = [
opt.attrib['value']
for opt in select.findall('option')
if opt.text == 'Comicon 2016'
][0]
new_page.form.submit_fields().append(('photo_album_id', album_id))

# new_page.form: Form
new_page.form.submit().follow()
client.get('/topics/organisation/test')

# works in the browser, but not here
# assert 'photoswipe' in topic

0 comments on commit ea171ca

Please sign in to comment.