misc: allow running with django 1.11 (#15973)
This commit is contained in:
parent
70019d195a
commit
caeb1654f6
2
setup.py
2
setup.py
|
@ -135,7 +135,7 @@ setup(
|
|||
'Programming Language :: Python',
|
||||
'Programming Language :: Python :: 2',
|
||||
],
|
||||
install_requires=['django>=1.8, <1.9',
|
||||
install_requires=['django>=1.8, <1.12',
|
||||
'gadjo',
|
||||
'djangorestframework>=3.1, <3.7',
|
||||
'django-jsonfield >= 0.9.3',
|
||||
|
|
|
@ -54,7 +54,7 @@ def login(app, username='admin', password='admin'):
|
|||
|
||||
def test_unlogged_access(app):
|
||||
# connect while not being logged in
|
||||
assert app.get('/manage/', status=302).location == 'http://testserver/login/?next=/manage/'
|
||||
assert app.get('/manage/', status=302).location.endswith('/login/?next=/manage/')
|
||||
|
||||
def test_simple_user_access(app, simple_user):
|
||||
# connect while being logged as a simple user, access should be forbidden
|
||||
|
@ -82,7 +82,7 @@ def test_manager_user_access(app, manager_user):
|
|||
assert app.get('/manage/', status=200)
|
||||
|
||||
def test_home_redirect(app):
|
||||
assert app.get('/', status=302).location == 'http://testserver/manage/'
|
||||
assert app.get('/', status=302).location.endswith('/manage/')
|
||||
|
||||
def test_access(app, admin_user):
|
||||
app = login(app)
|
||||
|
@ -93,12 +93,7 @@ def test_access(app, admin_user):
|
|||
def test_logout(app, admin_user):
|
||||
app = login(app)
|
||||
app.get('/logout/')
|
||||
assert app.get('/manage/', status=302).location == 'http://testserver/login/?next=/manage/'
|
||||
|
||||
def test_logout_next(app, admin_user):
|
||||
app = login(app)
|
||||
app.get('/logout/')
|
||||
assert app.get('/manage/', status=302).location == 'http://testserver/login/?next=/manage/'
|
||||
assert app.get('/manage/', status=302).location.endswith('/login/?next=/manage/')
|
||||
|
||||
def test_menu_json(app, admin_user):
|
||||
app = login(app)
|
||||
|
@ -132,7 +127,7 @@ def test_add_agenda(app, admin_user):
|
|||
resp = resp.form.submit()
|
||||
|
||||
agenda = Agenda.objects.get(label='Foo bar')
|
||||
assert resp.location == 'http://testserver/manage/agendas/%s/' % agenda.id
|
||||
assert resp.location.endswith('/manage/agendas/%s/' % agenda.id)
|
||||
resp = resp.follow()
|
||||
assert '<h2>Foo bar' in resp.body
|
||||
|
||||
|
@ -156,7 +151,7 @@ def test_options_agenda(app, admin_user):
|
|||
assert resp.form['label'].value == 'Foo bar'
|
||||
resp.form['label'] = 'Foo baz'
|
||||
resp = resp.form.submit()
|
||||
assert resp.location == 'http://testserver/manage/agendas/%s/' % agenda.id
|
||||
assert resp.location.endswith('/manage/agendas/%s/' % agenda.id)
|
||||
resp = resp.follow()
|
||||
assert '<h2>Foo baz' in resp.body
|
||||
|
||||
|
@ -179,7 +174,7 @@ def test_options_agenda_as_manager(app, manager_user):
|
|||
assert resp.form['label'].value == 'Foo bar'
|
||||
resp.form['label'] = 'Foo baz'
|
||||
resp = resp.form.submit()
|
||||
assert resp.location == 'http://testserver/manage/agendas/%s/' % agenda.id
|
||||
assert resp.location.endswith('/manage/agendas/%s/' % agenda.id)
|
||||
resp = resp.follow()
|
||||
assert '<h2>Foo baz' in resp.body
|
||||
|
||||
|
@ -191,7 +186,7 @@ def test_delete_agenda(app, admin_user):
|
|||
resp = resp.click('Foo bar')
|
||||
resp = resp.click('Delete')
|
||||
resp = resp.form.submit()
|
||||
assert resp.location == 'http://testserver/manage/'
|
||||
assert resp.location.endswith('/manage/')
|
||||
resp = resp.follow()
|
||||
assert not 'Foo bar' in resp.body
|
||||
|
||||
|
@ -390,7 +385,7 @@ def test_delete_event(app, admin_user):
|
|||
resp = resp.click(href=r'/manage/events/%s/$' % event.id)
|
||||
resp = resp.click('Delete')
|
||||
resp = resp.form.submit()
|
||||
assert resp.location == 'http://testserver/manage/agendas/%s/' % agenda.id
|
||||
assert resp.location.endswith('/manage/agendas/%s/' % agenda.id)
|
||||
assert Event.objects.count() == 0
|
||||
|
||||
def test_delete_busy_event(app, admin_user):
|
||||
|
@ -439,7 +434,7 @@ def test_delete_event_as_manager(app, manager_user):
|
|||
resp = resp.click(href=r'/manage/events/%s/$' % event.id)
|
||||
resp = resp.click('Delete')
|
||||
resp = resp.form.submit()
|
||||
assert resp.location == 'http://testserver/manage/agendas/%s/' % agenda.id
|
||||
assert resp.location.endswith('/manage/agendas/%s/' % agenda.id)
|
||||
assert Event.objects.count() == 0
|
||||
|
||||
def test_import_events(app, admin_user):
|
||||
|
@ -527,7 +522,7 @@ def test_add_meetings_agenda(app, admin_user):
|
|||
resp.form['kind'] = 'meetings'
|
||||
resp = resp.form.submit()
|
||||
agenda = Agenda.objects.get(label='Foo bar')
|
||||
assert resp.location == 'http://testserver/manage/agendas/%s/' % agenda.id
|
||||
assert resp.location.endswith('/manage/agendas/%s/' % agenda.id)
|
||||
resp = resp.follow()
|
||||
assert '<h2>Foo bar' in resp.body
|
||||
assert 'Meeting Types' in resp.body
|
||||
|
@ -567,7 +562,7 @@ def test_meetings_agenda_delete_meeting_type(app, admin_user):
|
|||
resp = resp.click('Blah')
|
||||
resp = resp.click('Delete')
|
||||
resp = resp.form.submit()
|
||||
assert resp.location == 'http://testserver/manage/agendas/%s/' % agenda.id
|
||||
assert resp.location.endswith('/manage/agendas/%s/' % agenda.id)
|
||||
assert MeetingType.objects.count() == 0
|
||||
|
||||
def test_meetings_agenda_add_time_period(app, admin_user):
|
||||
|
@ -627,7 +622,7 @@ def test_meetings_agenda_delete_time_period(app, admin_user):
|
|||
resp = resp.click('Wednesday')
|
||||
resp = resp.click('Delete')
|
||||
resp = resp.form.submit()
|
||||
assert resp.location == 'http://testserver/manage/agendas/%s/' % agenda.id
|
||||
assert resp.location.endswith('/manage/agendas/%s/' % agenda.id)
|
||||
assert TimePeriod.objects.count() == 0
|
||||
|
||||
|
||||
|
|
|
@ -10,12 +10,12 @@ pytestmark = pytest.mark.django_db
|
|||
def test_sso(app):
|
||||
with override_settings(MELLON_IDENTITY_PROVIDERS=[{'METADATA': 'x', 'ENTITY_ID': 'x'}]):
|
||||
resp = app.get('/login/')
|
||||
assert resp.location == 'http://testserver/accounts/mellon/login/'
|
||||
assert resp.location.endswith('/accounts/mellon/login/')
|
||||
|
||||
resp = app.get('/login/?next=/manage/')
|
||||
assert resp.location == 'http://testserver/accounts/mellon/login/?next=/manage/'
|
||||
assert resp.location.endswith('/accounts/mellon/login/?next=/manage/')
|
||||
|
||||
def test_slo(app):
|
||||
with override_settings(MELLON_IDENTITY_PROVIDERS=[{'METADATA': 'x', 'ENTITY_ID': 'x'}]):
|
||||
resp = app.get('/logout/')
|
||||
assert resp.location == 'http://testserver/accounts/mellon/logout/'
|
||||
assert resp.location.endswith('/accounts/mellon/logout/')
|
||||
|
|
Loading…
Reference in New Issue