Révision a9ee9454
Ajouté par Nicolas Roche il y a plus de 4 ans
tests/test_user_pages.py | ||
---|---|---|
94 | 94 |
|
95 | 95 |
app = login(get_app(pub), username='user', password='user') |
96 | 96 |
resp = app.get('/myspace/') |
97 |
assert 'Status1' in resp |
|
98 |
assert '<a href="/cat/test/%s/"' % formdata.id in resp |
|
99 |
assert 'Draft' in resp |
|
100 |
assert '<a href="/cat/test/%s"' % draft.id in resp |
|
101 |
resp = app.get('/cat/test/%s' % formdata.id) |
|
97 |
assert formdata.id != draft.id |
|
98 |
assert '<a href="test/%s/"' % formdata.id in resp |
|
99 |
assert '<a href="test/%s"' % draft.id in resp |
|
100 |
resp = app.get('/test/%s' % formdata.id) |
|
102 | 101 |
resp.status_int = 200 |
103 |
resp = app.get('/cat/test/%s' % draft.id, status=302) |
|
102 |
resp = app.get('/test/%s' % draft.id, status=302) |
|
103 |
resp = resp.follow(status=302) |
|
104 |
resp.location.startswith('http://example.net/test/?mt=') |
|
104 | 105 |
resp = resp.follow(status=302) |
105 | 106 |
resp.location.startswith('http://example.net/cat/test/?mt=') |
106 | 107 |
resp = resp.follow(status=200) |
... | ... | |
109 | 110 |
formdef.disabled = True |
110 | 111 |
formdef.store() |
111 | 112 |
resp = app.get('/myspace/') |
112 |
assert 'Status1' in resp |
|
113 |
assert '<a href="/cat/test/%s/"' % formdata.id in resp |
|
114 |
assert not 'Draft' in resp |
|
115 |
assert not '<a href="/cat/test/%s"' % draft.id in resp |
|
113 |
assert formdata.id != draft.id |
|
114 |
assert '<a href="test/%s/"' % formdata.id in resp |
|
115 |
assert not '<a href="test/%s"' % draft.id in resp |
|
116 | 116 |
resp = app.get('/cat/test/%s' % formdata.id) |
117 | 117 |
resp.status_int = 200 |
118 | 118 |
resp = app.get('/cat/test/%s' % draft.id, status=302) |
119 | 119 |
resp = resp.follow(status=302) |
120 |
resp.location.startswith('http://example.net/cat/test/?mt=')
|
|
120 |
resp.location.startswith('http://example.net/test/?mt=') |
|
121 | 121 |
resp = resp.follow(status=403) |
122 | 122 |
|
123 | 123 |
def test_form_category_redirection(): |
Formats disponibles : Unified diff
myspace: upgrade sort and remove dedicated display form (#38761)