Skip to content

Commit

Permalink
http://luc.lino-framework.org/blog/2015/0724.html
Browse files Browse the repository at this point in the history
  • Loading branch information
lsaffre committed Jul 24, 2015
1 parent 4e06989 commit b4f1c19
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 80 deletions.
6 changes: 2 additions & 4 deletions docs/specs/ledger.rst
Expand Up @@ -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)
<BLANKLINE>
Create voucher in journal **Purchase invoices (PRC)**
Create voucher in journal **Purchase invoices (PRC)**

>>> rt.login('robin').show(rt.modules.vatless.VouchersByProject, karl)
<BLANKLINE>
Create voucher in journal **Purchase invoices (PRC)**
Create voucher in journal **Purchase invoices (PRC)**


Dr. Killian has sent several invoices for different clients:
Expand Down
2 changes: 1 addition & 1 deletion docs/tested/2015/0715.rst
Expand Up @@ -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):

Expand Down
23 changes: 11 additions & 12 deletions docs/tested/debts.rst
Expand Up @@ -5,6 +5,7 @@ Debts mediation
===============

.. How to test only this document:
$ python setup.py test -s tests.DocsTests.test_debts
Doctest initialization:
Expand Down Expand Up @@ -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
~~~~~~~~~~~~~~~
<BLANKLINE>
==================== ========= ======== ===== ============== ==============
Description Remarks Common Mr. Mrs. Total
-------------------- --------- -------- ----- -------------- --------------
Expand All @@ -395,6 +385,7 @@ Monthly incomes
~~~~~~~~~~~~~~~~
Monthly expenses
~~~~~~~~~~~~~~~~
<BLANKLINE>
====================== ================== =============== ============ ===== ====== ============
Description Remarks Yearly amount Common Mr. Mrs. Total
---------------------- ------------------ --------------- ------------ ----- ------ ------------
Expand Down Expand Up @@ -427,6 +418,7 @@ Monthly expenses
~~~~~~~~~~~~~~
Yearly incomes
~~~~~~~~~~~~~~
<BLANKLINE>
================================= ======== ===== ============ ============
Description Common Mr. Mrs. Total
--------------------------------- -------- ----- ------------ ------------
Expand All @@ -439,6 +431,7 @@ Yearly incomes
~~~~~
Taxes
~~~~~
<BLANKLINE>
===================== ========= =============== =========== ===== ====== ===========
Description Remarks Yearly amount Common Mr. Mrs. Total
--------------------- --------- --------------- ----------- ----- ------ -----------
Expand All @@ -454,6 +447,7 @@ Taxes
~~~~~~~~~~
Insurances
~~~~~~~~~~
<BLANKLINE>
===================== ========= =============== ========== ===== ====== ==========
Description Remarks Yearly amount Common Mr. Mrs. Total
--------------------- --------- --------------- ---------- ----- ------ ----------
Expand All @@ -468,6 +462,7 @@ Insurances
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Debts, outsanding payments and credits
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<BLANKLINE>
===================== ========= ============== ============ ===== ====== ============
Partner Remarks Monthly rate Common Mr. Mrs. Total
--------------------- --------- -------------- ------------ ----- ------ ------------
Expand All @@ -478,6 +473,7 @@ Debts, outsanding payments and credits
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bailiffs and cash collectors
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<BLANKLINE>
======================== =============================== ========= ============== ======== ============== ============== ==============
Debt collection agency Partner Remarks Monthly rate Common Mr. Mrs. Total
------------------------ ------------------------------- --------- -------------- -------- -------------- -------------- --------------
Expand All @@ -493,6 +489,7 @@ Bailiffs and cash collectors
------------------
Incomes & Expenses
------------------
<BLANKLINE>
========================================================= ==============
Description Amount
--------------------------------------------------------- --------------
Expand All @@ -505,6 +502,7 @@ Incomes & Expenses
-----------
Liabilities
-----------
<BLANKLINE>
================================= ==============
Description Amount
--------------------------------- --------------
Expand All @@ -517,6 +515,7 @@ Liabilities
------------------
Debts distribution
------------------
<BLANKLINE>
=============================== ================= ============== ============ ===========================
Creditor Description Debt % Monthly payback suggested
------------------------------- ----------------- -------------- ------------ ---------------------------
Expand Down
22 changes: 3 additions & 19 deletions docs/tested/dupable_clients.rst
Expand Up @@ -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)*
===========================================
<BLANKLINE>
*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)*
===============================
<BLANKLINE>
*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)*
===========================================
<BLANKLINE>
*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.
Expand Down
2 changes: 1 addition & 1 deletion docs/tested/general.rst
Expand Up @@ -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
Expand Down
32 changes: 16 additions & 16 deletions docs/tested/jobs.rst
Expand Up @@ -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
================= ================================ ==========================
<BLANKLINE>


Expand All @@ -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
======================== ================== ========================= ========== ================ ============== =============
<BLANKLINE>


Expand Down
31 changes: 9 additions & 22 deletions docs/tested/polls.rst
Expand Up @@ -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)

Expand Down Expand Up @@ -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
<BLANKLINE>
<BLANKLINE>

>>> rt.login('alicia').show(polls.AnswersByResponse, obj, nosummary=True)
=========================================================== ======================================================================= ===========
Expand Down Expand Up @@ -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
<BLANKLINE>
<BLANKLINE>

>>> rt.login('hubert').show(polls.AnswersByResponse, obj, nosummary=True)
... #doctest: +ELLIPSIS +NORMALIZE_WHITESPACE +REPORT_UDIFF
Expand Down
5 changes: 3 additions & 2 deletions docs/tested/uploads.rst
Expand Up @@ -79,7 +79,6 @@ DERICUM Daniel (121)

>>> rt.show(uploads.UploadsByClient, newcomer)
Identifizierendes Dokument: *8*
<BLANKLINE>

>>> rt.show(uploads.UploadsByClient, newcomer, nosummary=True)
============================ ============ ======= ============== =================== =======
Expand All @@ -99,9 +98,11 @@ DOBBELSTEIN Dorothée (124)

>>> rt.show(uploads.UploadsByClient, oldclient)
Aufenthaltserlaubnis: *9*
<BLANKLINE>
Arbeitserlaubnis: *10*
Führerschein: *11*
<BLANKLINE>
Führerschein: *11*


>>> rt.show(uploads.UploadsByClient, oldclient, nosummary=True)
====================== ============ ======= ============== =================== =======
Expand Down
1 change: 1 addition & 0 deletions 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
4 changes: 2 additions & 2 deletions lino_welfare/projects/eupen/tests/test_broken_gfks.py
Expand Up @@ -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)
Expand All @@ -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")
2 changes: 1 addition & 1 deletion lino_welfare/projects/std/tests/test_beid.py
Expand Up @@ -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.
Expand Down

0 comments on commit b4f1c19

Please sign in to comment.