From 80c5a18b7dd5d887701a0b4bdde20b5450de27af Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= <fpeters@entrouvert.com>
Date: Tue, 26 Nov 2019 14:13:26 +0100
Subject: [PATCH 6/6] update tests after module removals (#37967)

---
 tests/test_admin_pages.py |  6 ++--
 tests/test_user_pages.py  | 61 ---------------------------------------
 2 files changed, 3 insertions(+), 64 deletions(-)

diff --git a/tests/test_admin_pages.py b/tests/test_admin_pages.py
index 3f39432..088f055 100644
--- a/tests/test_admin_pages.py
+++ b/tests/test_admin_pages.py
@@ -98,7 +98,7 @@ def test_aq_permissions_panel(empty_siteoptions):
     with open(os.path.join(pub.app_dir, 'site-options.cfg'), 'w') as fd:
         if not pub.site_options.has_section('options'):
             pub.site_options.add_section('options')
-        pub.site_options.set('options', 'auquotidien-links', 'true')
+        pub.site_options.set('options', 'auquotidien-payments', 'true')
         pub.site_options.write(fd)
 
     resp = app.get('/backoffice/settings/')
@@ -112,10 +112,10 @@ def test_menu_items(empty_siteoptions):
     with open(os.path.join(pub.app_dir, 'site-options.cfg'), 'w') as fd:
         if not pub.site_options.has_section('options'):
             pub.site_options.add_section('options')
-        pub.site_options.set('options', 'auquotidien-links', 'true')
+        pub.site_options.set('options', 'auquotidien-payments', 'true')
         pub.site_options.write(fd)
 
-    for area in ('links', 'announces', 'events', 'links', 'payments'):
+    for area in ('payments',):
 
         with open(os.path.join(pub.app_dir, 'site-options.cfg'), 'w') as fd:
             if not pub.site_options.has_section('options'):
diff --git a/tests/test_user_pages.py b/tests/test_user_pages.py
index 25a8736..65b0711 100644
--- a/tests/test_user_pages.py
+++ b/tests/test_user_pages.py
@@ -120,67 +120,6 @@ def test_myspace_with_user_forms():
     resp.location.startswith('http://example.net/cat/test/?mt=')
     resp = resp.follow(status=403)
 
-def test_announces():
-    from modules.announces import Announce, AnnounceSubscription
-
-    if not 'misc' in pub.cfg:
-        pub.cfg['misc'] = {}
-    pub.cfg['misc']['announce_themes'] = ['Foo', 'Bar']
-    pub.write_cfg()
-
-    announce = Announce()
-    announce.title = 'Hello World'
-    announce.text = 'Lorem ipsum...'
-    announce.publication_time = time.gmtime(time.time()-100000)
-    announce.store()
-
-    user = create_user()
-    app = login(get_app(pub), username='user', password='user')
-    resp = app.get('/announces/', status=200)
-    resp = resp.click('Receiving those Announces')
-    resp = resp.click('Email')
-    assert 'You are logged in but there is no email address in your profile.' in resp.body
-    assert 'email' in resp.form.fields
-    user.email = 'foo@localhost'
-    user.store()
-    resp = app.get('/announces/email', status=200)
-    assert 'foo@localhost' in resp.body
-    assert not 'email' in resp.form.fields
-    resp = resp.form.submit()
-    assert AnnounceSubscription.count() == 1
-
-    resp = app.get('/myspace/', status=200)
-    resp = resp.click('Edit my Subscription to Announces')
-    assert resp.form['themes$elementFoo'].checked
-    assert resp.form['themes$elementBar'].checked
-    resp.form['themes$elementFoo'].checked = False
-    resp = resp.form.submit('submit')
-    assert AnnounceSubscription.count() == 1
-
-    resp = app.get('/myspace/announces', status=200)
-    assert not resp.form['themes$elementFoo'].checked
-    assert resp.form['themes$elementBar'].checked
-
-def test_agenda():
-    from modules.events import Event, RemoteCalendar
-
-    remote_calendar = RemoteCalendar()
-    remote_calendar.label = 'Remote'
-    remote_calendar.store()
-
-    event = Event()
-    event.title = 'Hello World'
-    event.description = 'Lorem ipsum...'
-    event.date_start = time.strptime('2016-09-10', '%Y-%m-%d')
-    event.date_end = time.strptime('2016-09-12', '%Y-%m-%d')
-    event.store()
-
-    app = get_app(pub)
-    resp = app.get('/agenda/', status=200)
-    resp = app.get('/agenda/filter')
-    assert 'tags$element0' in resp.form.fields
-    assert 'calendars$element0' in resp.form.fields
-
 def test_form_category_redirection():
     Category.wipe()
     cat = Category(name='baz')
-- 
2.24.0

