From b4f1c191b0776e46b62d4a3a633537727c36194f Mon Sep 17 00:00:00 2001 From: Luc Saffre Date: Fri, 24 Jul 2015 12:19:10 +0300 Subject: [PATCH] http://luc.lino-framework.org/blog/2015/0724.html --- docs/specs/ledger.rst | 6 ++-- docs/tested/2015/0715.rst | 2 +- docs/tested/debts.rst | 23 +++++++------ docs/tested/dupable_clients.rst | 22 ++----------- docs/tested/general.rst | 2 +- docs/tested/jobs.rst | 32 +++++++++---------- docs/tested/polls.rst | 31 ++++++------------ docs/tested/uploads.rst | 5 +-- docs/warnings_html.txt | 1 + .../projects/eupen/tests/test_broken_gfks.py | 4 +-- lino_welfare/projects/std/tests/test_beid.py | 2 +- 11 files changed, 50 insertions(+), 80 deletions(-) diff --git a/docs/specs/ledger.rst b/docs/specs/ledger.rst index 0ee3eed2..c15d0ea5 100644 --- a/docs/specs/ledger.rst +++ b/docs/specs/ledger.rst @@ -179,12 +179,10 @@ recipient" and to a "client". >>> killian = rt.modules.contacts.Person.objects.get(pk=227) >>> karl = rt.modules.pcsw.Client.objects.get(pk=141) >>> rt.login('robin').show(rt.modules.vatless.VouchersByPartner, killian) - -Create voucher in journal **Purchase invoices (PRC)** +Create voucher in journal **Purchase invoices (PRC)** >>> rt.login('robin').show(rt.modules.vatless.VouchersByProject, karl) - -Create voucher in journal **Purchase invoices (PRC)** +Create voucher in journal **Purchase invoices (PRC)** Dr. Killian has sent several invoices for different clients: diff --git a/docs/tested/2015/0715.rst b/docs/tested/2015/0715.rst index 04366682..52691c7f 100644 --- a/docs/tested/2015/0715.rst +++ b/docs/tested/2015/0715.rst @@ -103,7 +103,7 @@ But when generating the js files, py2js and declare_vars filter it away: ... #doctest: +NORMALIZE_WHITESPACE [ general_panel142, contact_panel166, coaching_panel401, aids_tab_panel496, work_tab_1_panel525, history_panel1245, -ledger_panel1316 ] +ledger_panel1317 ] I can even render the lino*.js file (at least once): diff --git a/docs/tested/debts.rst b/docs/tested/debts.rst index e6cc6764..703154b4 100644 --- a/docs/tested/debts.rst +++ b/docs/tested/debts.rst @@ -5,6 +5,7 @@ Debts mediation =============== .. How to test only this document: + $ python setup.py test -s tests.DocsTests.test_debts Doctest initialization: @@ -362,23 +363,12 @@ Here is now (almost) the whole content of a printed budget. >>> obj = debts.Budget.objects.get(pk=4) ->> def story2rst(story): -.. for i in ses.story2html(story): -.. if E.iselement(i): -.. print(html2rst(i)) - - ->> from lino.utils.xmlgen.html import html2rst ->> def story2rst(story): -.. for ln in ses.story2rst(story): -.. print(ln) - - >>> ses.story2rst(obj.data_story(ses)) ... #doctest: +REPORT_UDIFF ~~~~~~~~~~~~~~~ Monthly incomes ~~~~~~~~~~~~~~~ + ==================== ========= ======== ===== ============== ============== Description Remarks Common Mr. Mrs. Total -------------------- --------- -------- ----- -------------- -------------- @@ -395,6 +385,7 @@ Monthly incomes ~~~~~~~~~~~~~~~~ Monthly expenses ~~~~~~~~~~~~~~~~ + ====================== ================== =============== ============ ===== ====== ============ Description Remarks Yearly amount Common Mr. Mrs. Total ---------------------- ------------------ --------------- ------------ ----- ------ ------------ @@ -427,6 +418,7 @@ Monthly expenses ~~~~~~~~~~~~~~ Yearly incomes ~~~~~~~~~~~~~~ + ================================= ======== ===== ============ ============ Description Common Mr. Mrs. Total --------------------------------- -------- ----- ------------ ------------ @@ -439,6 +431,7 @@ Yearly incomes ~~~~~ Taxes ~~~~~ + ===================== ========= =============== =========== ===== ====== =========== Description Remarks Yearly amount Common Mr. Mrs. Total --------------------- --------- --------------- ----------- ----- ------ ----------- @@ -454,6 +447,7 @@ Taxes ~~~~~~~~~~ Insurances ~~~~~~~~~~ + ===================== ========= =============== ========== ===== ====== ========== Description Remarks Yearly amount Common Mr. Mrs. Total --------------------- --------- --------------- ---------- ----- ------ ---------- @@ -468,6 +462,7 @@ Insurances ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Debts, outsanding payments and credits ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ===================== ========= ============== ============ ===== ====== ============ Partner Remarks Monthly rate Common Mr. Mrs. Total --------------------- --------- -------------- ------------ ----- ------ ------------ @@ -478,6 +473,7 @@ Debts, outsanding payments and credits ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bailiffs and cash collectors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ======================== =============================== ========= ============== ======== ============== ============== ============== Debt collection agency Partner Remarks Monthly rate Common Mr. Mrs. Total ------------------------ ------------------------------- --------- -------------- -------- -------------- -------------- -------------- @@ -493,6 +489,7 @@ Bailiffs and cash collectors ------------------ Incomes & Expenses ------------------ + ========================================================= ============== Description Amount --------------------------------------------------------- -------------- @@ -505,6 +502,7 @@ Incomes & Expenses ----------- Liabilities ----------- + ================================= ============== Description Amount --------------------------------- -------------- @@ -517,6 +515,7 @@ Liabilities ------------------ Debts distribution ------------------ + =============================== ================= ============== ============ =========================== Creditor Description Debt % Monthly payback suggested ------------------------------- ----------------- -------------- ------------ --------------------------- diff --git a/docs/tested/dupable_clients.rst b/docs/tested/dupable_clients.rst index f1e1dc06..4994e226 100644 --- a/docs/tested/dupable_clients.rst +++ b/docs/tested/dupable_clients.rst @@ -90,31 +90,15 @@ The detail window of each of these records shows some of the other records in the `SimilarClients` table: >>> rt.show(dupable_clients.SimilarClients, pcsw.Client.objects.get(pk=122)) -=========================================== - Similar record -------------------------------------------- - *DOBBELSTEIN-DEMEULENAERE Dorothée (123)* -=========================================== - +*DOBBELSTEIN-DEMEULENAERE Dorothée (123)* Phonetic words: TMLN, TR0 >>> rt.show(dupable_clients.SimilarClients, pcsw.Client.objects.get(pk=123)) ... #doctest: +ELLIPSIS +NORMALIZE_WHITESPACE +REPORT_UDIFF -=============================== - Similar record -------------------------------- - *DEMEULENAERE Dorothée (122)* - *DOBBELSTEIN Dorothée (124)* -=============================== - +*DEMEULENAERE Dorothée (122)* *DOBBELSTEIN Dorothée (124)* Phonetic words: TPLS, TMLN, TR0 >>> rt.show(dupable_clients.SimilarClients, pcsw.Client.objects.get(pk=124)) ... #doctest: +ELLIPSIS +NORMALIZE_WHITESPACE +REPORT_UDIFF -=========================================== - Similar record -------------------------------------------- - *DOBBELSTEIN-DEMEULENAERE Dorothée (123)* -=========================================== - +*DOBBELSTEIN-DEMEULENAERE Dorothée (123)* Phonetic words: TPLS, TR0 Note how the result can differ depending on the partner. Our algorithm is not perfect and does not detect all duplicates. diff --git a/docs/tested/general.rst b/docs/tested/general.rst index 4fcb1acb..aa14df71 100644 --- a/docs/tested/general.rst +++ b/docs/tested/general.rst @@ -352,7 +352,7 @@ There are *detail* layouts, *insert* layouts and *action parameter* layouts. - pcsw.ClientContactTypes.insert (viewable for 110, 410, admin) : id, name, name_fr, name_de, name_nl - pcsw.ClientStates.wf1 (viewable for 200, 300, admin) : reason, remark - pcsw.Clients.create_visit (viewable for all except anonymous) : user, summary -- pcsw.Clients.detail (viewable for all except anonymous) : overview, gender, id, first_name, middle_name, last_name, birth_date, age, national_id, nationality, declared_name, civil_state, birth_country, birth_place, language, email, phone, fax, gsm, image, AgentsByClient, SimilarClients, LinksByHuman, cbss_relations, MembersByPerson, workflow_buttons, broker, faculty, refusal_reason, in_belgium_since, residence_type, residence_until, group, is_seeking, unemployed_since, work_permit_suspended_until, needs_residence_permit, needs_work_permit, UploadsByClient, skills, obstacles, ExcerptsByProject, VouchersByPartner, activity, client_state, noble_condition, unavailable_until, unavailable_why, is_obsolete, created, modified, remarks +- pcsw.Clients.detail (viewable for all except anonymous) : overview, gender, id, first_name, middle_name, last_name, birth_date, age, national_id, nationality, declared_name, civil_state, birth_country, birth_place, language, email, phone, fax, gsm, image, AgentsByClient, SimilarClients, LinksByHuman, cbss_relations, MembersByPerson, workflow_buttons, broker, faculty, refusal_reason, in_belgium_since, residence_type, residence_until, group, is_seeking, unemployed_since, work_permit_suspended_until, needs_residence_permit, needs_work_permit, UploadsByClient, skills, obstacles, ExcerptsByProject, VouchersByProject, activity, client_state, noble_condition, unavailable_until, unavailable_why, is_obsolete, created, modified, remarks - pcsw.Clients.insert (viewable for all except anonymous) : first_name, last_name, national_id, gender, language - pcsw.Clients.merge_row (viewable for admin) : merge_to, aids_SimpleConfirmation, aids_IncomeConfirmation, aids_RefundConfirmation, pcsw_Coaching, pcsw_Dispense, dupable_clients_Word, reason - pcsw.CoachingEndings.insert (viewable for 110, 410, admin) : id, name, name_fr, name_de, name_nl, seqno diff --git a/docs/tested/jobs.rst b/docs/tested/jobs.rst index 447f17ff..88871327 100644 --- a/docs/tested/jobs.rst +++ b/docs/tested/jobs.rst @@ -36,18 +36,18 @@ The central concept added by this module is a table of **jobs**. >>> with translation.override('de'): ... ses.show(jobs.Jobs, column_names="function provider sector") ... #doctest: +ELLIPSIS +NORMALIZE_WHITESPACE -================= ================================ =========================== +================= ================================ ========================== Funktion Stellenanbieter Sektor ------------------ -------------------------------- --------------------------- - Kellner BISA Landwirtschaft & Garten - Kellner R-Cycle Sperrgutsortierzentrum Horeca - Koch R-Cycle Sperrgutsortierzentrum Seefahrt - Koch Pro Aktiv V.o.G. Unterricht - Küchenassistent Pro Aktiv V.o.G. Medizin & Paramedizin - Küchenassistent BISA Reinigung - Tellerwäscher BISA Bauwesen & Gebäudepflege - Tellerwäscher R-Cycle Sperrgutsortierzentrum Transport -================= ================================ =========================== +----------------- -------------------------------- -------------------------- + Kellner BISA Landwirtschaft & Garten + Kellner R-Cycle Sperrgutsortierzentrum Horeca + Koch R-Cycle Sperrgutsortierzentrum Seefahrt + Koch Pro Aktiv V.o.G. Unterricht + Küchenassistent Pro Aktiv V.o.G. Medizin & Paramedizin + Küchenassistent BISA Reinigung + Tellerwäscher BISA Bauwesen & Gebäudepflege + Tellerwäscher R-Cycle Sperrgutsortierzentrum Transport +================= ================================ ========================== @@ -73,11 +73,11 @@ Job Offers >>> # settings.SITE.catch_layout_exceptions = False >>> ses.show(jobs.Offers) #doctest: +ELLIPSIS +NORMALIZE_WHITESPACE -======================== ================== ========================== ========== ================ ============== ============= - Name Stellenanbieter Sektor Funktion Beginn Auswahl Ende Auswahl Beginndatum ------------------------- ------------------ -------------------------- ---------- ---------------- -------------- ------------- - Übersetzer DE-FR (m/w) Pro Aktiv V.o.G. Landwirtschaft & Garten Kellner 22.01.14 02.05.14 01.06.14 -======================== ================== ========================== ========== ================ ============== ============= +======================== ================== ========================= ========== ================ ============== ============= + Name Stellenanbieter Sektor Funktion Beginn Auswahl Ende Auswahl Beginndatum +------------------------ ------------------ ------------------------- ---------- ---------------- -------------- ------------- + Übersetzer DE-FR (m/w) Pro Aktiv V.o.G. Landwirtschaft & Garten Kellner 22.01.14 02.05.14 01.06.14 +======================== ================== ========================= ========== ================ ============== ============= diff --git a/docs/tested/polls.rst b/docs/tested/polls.rst index 224ce4a1..6bae34cb 100644 --- a/docs/tested/polls.rst +++ b/docs/tested/polls.rst @@ -8,29 +8,20 @@ A tested tour into the :mod:`lino_welfare.modlib.polls` plugin. .. How to test only this document: - $ python setup.py test -s tests.DocsTests.test_polls + $ python setup.py test -s tests.DocsTests.test_polls + + doctest init: + + >>> from __future__ import print_function + >>> import os + >>> os.environ['DJANGO_SETTINGS_MODULE'] = \ + ... 'lino_welfare.projects.chatelet.settings.doctests' + >>> from lino.api.doctest import * .. contents:: :depth: 2 -About this document -=================== - -.. include:: /include/tested.rst - -This documents uses the :mod:`lino_welfare.projects.chatelet` test -database: - ->>> from __future__ import print_function ->>> import os ->>> os.environ['DJANGO_SETTINGS_MODULE'] = \ -... 'lino_welfare.projects.chatelet.settings.doctests' ->>> from lino.api.doctest import * - ->>> print(settings.SETTINGS_MODULE) -lino_welfare.projects.chatelet.settings.doctests - >>> dd.today() datetime.date(2014, 5, 22) @@ -198,8 +189,6 @@ Question *3/3/14* 4/2/14 *5/2/14* Temps de travail acceptés 3/4 **temps-plein** ****[3/4]**** **1/2** **quelques heures par semaine** (**Remark**) 3/4 - - >>> rt.login('alicia').show(polls.AnswersByResponse, obj, nosummary=True) =========================================================== ======================================================================= =========== @@ -254,8 +243,6 @@ Question *3/3/14* 4/2/14 *5/2/14* Temps de travail acceptés 3/4 3/4 3/4 - - >>> rt.login('hubert').show(polls.AnswersByResponse, obj, nosummary=True) ... #doctest: +ELLIPSIS +NORMALIZE_WHITESPACE +REPORT_UDIFF diff --git a/docs/tested/uploads.rst b/docs/tested/uploads.rst index 1eda9882..cd236cbf 100644 --- a/docs/tested/uploads.rst +++ b/docs/tested/uploads.rst @@ -79,7 +79,6 @@ DERICUM Daniel (121) >>> rt.show(uploads.UploadsByClient, newcomer) Identifizierendes Dokument: *8* - >>> rt.show(uploads.UploadsByClient, newcomer, nosummary=True) ============================ ============ ======= ============== =================== ======= @@ -99,9 +98,11 @@ DOBBELSTEIN Dorothée (124) >>> rt.show(uploads.UploadsByClient, oldclient) Aufenthaltserlaubnis: *9* + Arbeitserlaubnis: *10* -Führerschein: *11* +Führerschein: *11* + >>> rt.show(uploads.UploadsByClient, oldclient, nosummary=True) ====================== ============ ======= ============== =================== ======= diff --git a/docs/warnings_html.txt b/docs/warnings_html.txt index f67c96a2..eb81d166 100644 --- a/docs/warnings_html.txt +++ b/docs/warnings_html.txt @@ -1,3 +1,4 @@ +/home/luc/hgwork/welfare/docs/specs/ledger.rst:2: WARNING: Explicit markup ends without a blank line; unexpected unindent. /home/luc/hgwork/welfare/docs/tour/reception.rst:7: WARNING: image file not readable: ../../lino/lino/media/extjs/images/xsite/link.png /home/luc/hgwork/welfare/docs/tour/reception.rst:30: WARNING: image file not readable: ../../lino/lino/media/extjs/images/xsite/link.png /home/luc/hgwork/welfare/docs/tested/2015/0717.rst:: WARNING: document isn't included in any toctree diff --git a/lino_welfare/projects/eupen/tests/test_broken_gfks.py b/lino_welfare/projects/eupen/tests/test_broken_gfks.py index 71dfee20..0a3c31a3 100644 --- a/lino_welfare/projects/eupen/tests/test_broken_gfks.py +++ b/lino_welfare/projects/eupen/tests/test_broken_gfks.py @@ -55,7 +55,7 @@ def create_related_objects(): self.assertEqual(Note.objects.all().count(), 0) ar = BrokenGFKs.request() rst = ar.to_rst() - self.assertEqual(rst, "\nKeine Daten anzuzeigen\n\n") + self.assertEqual(rst, "Keine Daten anzuzeigen\n") cli = create_related_objects() self.assertEqual(Note.objects.all().count(), 1) @@ -69,4 +69,4 @@ def create_related_objects(): self.assertEqual(Note.objects.all().count(), 0) rst = ar.to_rst() - self.assertEqual(rst, "\nKeine Daten anzuzeigen\n\n") + self.assertEqual(rst, "Keine Daten anzuzeigen\n") diff --git a/lino_welfare/projects/std/tests/test_beid.py b/lino_welfare/projects/std/tests/test_beid.py index 904610e4..1793e4a8 100644 --- a/lino_welfare/projects/std/tests/test_beid.py +++ b/lino_welfare/projects/std/tests/test_beid.py @@ -229,7 +229,7 @@ def test01(self): master_instance=obj) s = ar.to_rst() print(s) - self.assertEqual(s, "\nNo data to display\n\n") + self.assertEqual(s, "No data to display\n") # Last attempt for this card. No similar person exists. Create # new client from eid.