0001-tests-test-users-API-with-send_registration_email_ne.patch
tests/test_api.py | ||
---|---|---|
565 | 565 | |
566 | 566 |
# Use case is often that Email is the main identifier |
567 | 567 |
settings.A2_EMAIL_IS_UNIQUE = True |
568 |
settings.A2_REDIRECT_WHITELIST = ['http://example.com'] |
|
568 | 569 |
Attribute.objects.create(kind='title', name='title', label='title') |
569 | 570 | |
570 | 571 |
app.authorization = ('Basic', (superuser.username, superuser.username)) |
... | ... | |
575 | 576 |
'email': 'john.doe@example.net', |
576 | 577 |
'title': 'Mr', |
577 | 578 |
'send_registration_email': True, |
579 |
'send_registration_email_next_url': 'http://example.com/', |
|
578 | 580 |
} |
579 | 581 |
assert len(mail.outbox) == 0 |
580 | 582 |
resp = app.post_json('/api/users/', params=payload, status=201) |
... | ... | |
586 | 588 |
resp = app.get(relative_url, status=200) |
587 | 589 |
resp.form.set('new_password1', '1234==aA') |
588 | 590 |
resp.form.set('new_password2', '1234==aA') |
589 |
resp = resp.form.submit().follow()
|
|
591 |
resp = resp.form.submit() |
|
590 | 592 |
# Check user was properly logged in |
591 | 593 |
assert str(app.session['_auth_user_id']) == str(user_id) |
594 |
assert resp.location == 'http://example.com/' |
|
592 | 595 | |
593 | 596 | |
594 | 597 |
def test_api_users_create_force_password_reset(app, client, settings, superuser): |
595 |
- |