120 |
120 |
resp = app.get('http://localhost:80/manage/category/alerts/')
|
121 |
121 |
assert 'First announce' in resp.content
|
122 |
122 |
|
|
123 |
def test_edit_announce(app, admin_user):
|
|
124 |
app = login(app)
|
|
125 |
resp = app.get('/manage/')
|
|
126 |
assert 'New category' in resp.content
|
|
127 |
category_page = resp.click('New category')
|
|
128 |
category_form = category_page.forms[0]
|
|
129 |
category_form['name'] = 'Alerts'
|
|
130 |
resp = category_form.submit()
|
|
131 |
assert resp.status_int == 302
|
|
132 |
assert resp.location == 'http://localhost:80/manage/'
|
|
133 |
resp = app.get(resp.location)
|
|
134 |
resp = resp.click('Alerts')
|
|
135 |
assert 'New announce' in resp.content
|
|
136 |
announce_page = resp.click('New announce')
|
|
137 |
announce_form = announce_page.forms[0]
|
|
138 |
announce_form['title'] = 'First announce'
|
|
139 |
announce_form['text'] = 'announce content'
|
|
140 |
resp = announce_form.submit()
|
|
141 |
assert resp.status_int == 302
|
|
142 |
assert resp.location == 'http://localhost:80/manage/category/alerts/'
|
|
143 |
resp = app.get(resp.location)
|
|
144 |
assert 'First announce' in resp.content
|
|
145 |
announce_edit_page = resp.click('First announce')
|
|
146 |
edit_form = announce_edit_page.forms[0]
|
|
147 |
edit_form['publication_time'] = '2017-03-03 09:00:00'
|
|
148 |
resp = edit_form.submit()
|
|
149 |
assert resp.status_int == 302
|
|
150 |
assert resp.location == 'http://localhost:80/manage/category/alerts/'
|
123 |
151 |
|
124 |
152 |
def test_delete_announce(app, admin_user):
|
125 |
153 |
app = login(app)
|
126 |
|
-
|