584 |
584 |
app.get('/manage/users/import/%s/%s/' % (_import.uuid, execute.uuid), status=403)
|
585 |
585 |
|
586 |
586 |
|
|
587 |
def test_user_import_legacy_encoding(transactional_db, app, admin, ou1, admin_ou1):
|
|
588 |
response = login(app, admin, '/manage/users/')
|
|
589 |
response = response.click('Import users')
|
|
590 |
response.form.set(
|
|
591 |
'import_file',
|
|
592 |
Upload(
|
|
593 |
'users.csv',
|
|
594 |
'''email key verified,first_name,last_name,phone
|
|
595 |
tnoel@entrouvert.com,Thomas,Noël,1234
|
|
596 |
fpeters@entrouvert.com,Frédéric,Péters,5678
|
|
597 |
john.doe@entrouvert.com,John,Doe,9101112
|
|
598 |
x,x,x,x'''.encode(
|
|
599 |
'utf-8'
|
|
600 |
),
|
|
601 |
'application/octet-stream',
|
|
602 |
),
|
|
603 |
)
|
|
604 |
response.form.set('encoding', 'utf-8-sig')
|
|
605 |
response.form.set('ou', str(get_default_ou().pk))
|
|
606 |
response = response.form.submit()
|
|
607 |
|
|
608 |
imports = [i for i in user_import.UserImport.all()]
|
|
609 |
# oops, utf-8 used to be supported. now it's utf-8-sig but imports may have
|
|
610 |
# been created with utf-8 encoding and not executed yet
|
|
611 |
with imports[0].meta_update as meta:
|
|
612 |
meta['encoding'] = 'utf-8' # not supported anymore
|
|
613 |
|
|
614 |
response = response.follow()
|
|
615 |
response = response.forms['action-form'].submit(name='simulate')
|
|
616 |
|
|
617 |
|
587 |
618 |
def test_su_permission(app, admin, simple_user):
|
588 |
619 |
resp = login(app, admin, '/manage/users/%s/' % simple_user.pk)
|
589 |
620 |
assert len(resp.pyquery('button[name="su"]')) == 0
|
590 |
|
-
|