-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Newsletter: Extend newsletter export by status column (confirmed)
TYPE: Feature LINK: ogc-1645
- Loading branch information
1 parent
ac6c2a1
commit 201f976
Showing
4 changed files
with
47 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,27 +27,39 @@ def test_newsletter_collection(session): | |
def test_recipient_collection(session): | ||
|
||
recipients = RecipientCollection(session) | ||
r = recipients.add("[email protected]") | ||
r1 = recipients.add("[email protected]", confirmed=True) | ||
r2 = recipients.add("[email protected]", group='tech', confirmed=False) | ||
|
||
assert r.address == "[email protected]" | ||
assert r.group is None | ||
assert recipients.count() == 2 | ||
assert r1.address == "[email protected]" | ||
assert r1.group is None | ||
assert r1.confirmed | ||
assert r2.address == "[email protected]" | ||
assert r2.group == 'tech' | ||
assert not r2.confirmed | ||
|
||
r = recipients.by_id(r.id) | ||
r1 = recipients.by_id(r1.id) | ||
|
||
assert r.address == "[email protected]" | ||
assert r.group is None | ||
assert r1.address == "[email protected]" | ||
assert r1.group is None | ||
|
||
r = recipients.by_address(r.address, 'abc') | ||
assert r is None | ||
assert recipients.by_id('abc') is None | ||
assert recipients.by_address(r1.address, 'abc') is None | ||
|
||
r = recipients.by_address('[email protected]') | ||
assert recipients.ordered_by_status_address().all() == [r2, r1] | ||
|
||
assert r.address == "[email protected]" | ||
assert r.group is None | ||
r1 = recipients.by_address('[email protected]') | ||
|
||
recipients.delete(r) | ||
assert r1.address == "[email protected]" | ||
assert r1.group is None | ||
|
||
recipients.delete(r1) | ||
|
||
assert recipients.by_address('[email protected]') is None | ||
assert recipients.count() == 1 | ||
|
||
recipients.delete(r2) | ||
assert recipients.count() == 0 | ||
|
||
|
||
def test_newsletter_already_exists(session): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -522,15 +522,15 @@ def test_import_export_subscribers(client): | |
page.form['file_format'] = 'json' | ||
response = page.form.submit().json | ||
assert response == [ | ||
{'Adresse': '[email protected]'}, | ||
{'Adresse': '[email protected]'}, | ||
{'Adresse': '[email protected]', 'Bestätigt': True}, | ||
{'Adresse': '[email protected]', 'Bestätigt': True}, | ||
] | ||
|
||
page.form['file_format'] = 'xlsx' | ||
|
||
more_recipients = [ | ||
{'Adresse': '[email protected]'}, | ||
{'Adresse': '[email protected]'}, | ||
{'Adresse': '[email protected]', 'Bestätigt': True}, | ||
{'Adresse': '[email protected]', 'Bestätigt': False}, | ||
] | ||
file = Upload( | ||
'file', | ||
|