LIMS-1446, LIMS-1444, LIMS-1443

Fixes:

[LIMS-1446 After retracting a published AR the Sample gets cancelled](https://jira.bikalabs.com/browse/LIMS-1446)
[LIMS-1444 In AR published report accredited analysis services are not marked as accredited](https://jira.bikalabs.com/browse/LIMS-1444)
[LIMS-1443: In published reports the publishing date is not shown in the pdf](https://jira.bikalabs.com/browse/LIMS-1443)


```
jordi@darwin:~/dev/xispa/bikalims/zinstance$ bin/test -m bika.lims
Running bika.lims.testing.BikaTestingLayer:Functional tests:
  Set up plone.testing.zca.LayerCleanup in 0.000 seconds.
  Set up plone.testing.z2.Startup in 0.799 seconds.
  Set up plone.app.testing.layers.PloneFixture in 15.969 seconds.
  Set up bika.lims.testing.BikaTestLayer in 52.905 seconds.
  Set up bika.lims.testing.BikaTestingLayer:Functional in 0.000 seconds.
  Running:

  Ran 16 tests with 0 failures and 0 errors in 13.959 seconds.
Running bika.lims.testing.BikaTestingLayer:Robot tests:
  Tear down bika.lims.testing.BikaTestingLayer:Functional in 0.000 seconds.
  Set up plone.testing.z2.ZServer in 0.536 seconds.
  Set up bika.lims.testing.BikaTestingLayer:Robot in 0.000 seconds.
  Running:
    1/29 (3.4%)The following test left new threads behind:
Test Batch-AR (test_Batch.robot)
New thread(s): [<_DummyThread(Dummy-1, started daemon 140441904871168)>]
    2/29 (6.9%)
==============================================================================
test Batch
==============================================================================
Test batch inherited ARs                                              | FAIL |
ValueError: Element locator 'title' did not match any elements.
------------------------------------------------------------------------------
test Batch                                                            | FAIL |
1 critical test, 0 passed, 1 failed
1 test total, 0 passed, 1 failed
==============================================================================
Output:  /home/jordi/dev/xispa/bikalims/zinstance/parts/test/test_Batch/Test_batch_inherited_ARs/output.xml
Log:     /home/jordi/dev/xispa/bikalims/zinstance/parts/test/test_Batch/Test_batch_inherited_ARs/log.html
Report:  /home/jordi/dev/xispa/bikalims/zinstance/parts/test/test_Batch/Test_batch_inherited_ARs/report.html



Failure in test Test batch inherited ARs (test_Batch.robot)
Traceback (most recent call last):
  File "/home/jordi/dev/xispa/bikalims/buildout-cache/eggs/unittest2-0.5.1-py2.7.egg/unittest2/case.py", line 340, in run
    testMethod()
  File "/home/jordi/dev/xispa/bikalims/buildout-cache/eggs/robotsuite-1.3.3-py2.7.egg/robotsuite/__init__.py", line 360, in runTest
    assert last_status == 'PASS', last_message
AssertionError: ValueError: Element locator 'title' did not match any elements.

    5/29 (17.2%)[ WARN ] span.state-sample_received
    11/29 (37.9%)
==============================================================================
test RejectionWorkflow
==============================================================================
Reject worksheet with regular, blank, control and duplicate analyses  | FAIL |
ValueError: Element locator 'css=#worksheet_add_references .bika-listing-table tbody.item-listing-tbody tr' did not match any elements.
------------------------------------------------------------------------------
test RejectionWorkflow                                                | FAIL |
1 critical test, 0 passed, 1 failed
1 test total, 0 passed, 1 failed
==============================================================================
Output:  /home/jordi/dev/xispa/bikalims/zinstance/parts/test/test_RejectionWorkflow/Reject_worksheet_with_regular_blank_control_and_duplicate_analyses/output.xml
Log:     /home/jordi/dev/xispa/bikalims/zinstance/parts/test/test_RejectionWorkflow/Reject_worksheet_with_regular_blank_control_and_duplicate_analyses/log.html
Report:  /home/jordi/dev/xispa/bikalims/zinstance/parts/test/test_RejectionWorkflow/Reject_worksheet_with_regular_blank_control_and_duplicate_analyses/report.html



Failure in test Reject worksheet with regular blank control and duplicate analyses (test_RejectionWorkflow.robot)
Traceback (most recent call last):
  File "/home/jordi/dev/xispa/bikalims/buildout-cache/eggs/unittest2-0.5.1-py2.7.egg/unittest2/case.py", line 340, in run
    testMethod()
  File "/home/jordi/dev/xispa/bikalims/buildout-cache/eggs/robotsuite-1.3.3-py2.7.egg/robotsuite/__init__.py", line 360, in runTest
    assert last_status == 'PASS', last_message
AssertionError: ValueError: Element locator 'css=#worksheet_add_references .bika-listing-table tbody.item-listing-tbody tr' did not match any elements.

    14/29 (48.3%)[ WARN ] XXX Publication preferences are broken - the widgets need to make sense, and be adaptable.
[ WARN ] No archetypes-fieldname-CCContact field selected
    25/29 (86.2%)
==============================================================================
test ARTemplates
==============================================================================
Add an ARTemplate with Analysis Dependencies                          | FAIL |
ValueError: Element locator 'Method' did not match any elements.
------------------------------------------------------------------------------
test ARTemplates                                                      | FAIL |
1 critical test, 0 passed, 1 failed
1 test total, 0 passed, 1 failed
==============================================================================
Output:  /home/jordi/dev/xispa/bikalims/zinstance/parts/test/test_ARTemplates/Add_an_ARTemplate_with_Analysis_Dependencies/output.xml
Log:     /home/jordi/dev/xispa/bikalims/zinstance/parts/test/test_ARTemplates/Add_an_ARTemplate_with_Analysis_Dependencies/log.html
Report:  /home/jordi/dev/xispa/bikalims/zinstance/parts/test/test_ARTemplates/Add_an_ARTemplate_with_Analysis_Dependencies/report.html



Failure in test Add an ARTemplate with Analysis Dependencies (test_ARTemplates.robot)
Traceback (most recent call last):
  File "/home/jordi/dev/xispa/bikalims/buildout-cache/eggs/unittest2-0.5.1-py2.7.egg/unittest2/case.py", line 340, in run
    testMethod()
  File "/home/jordi/dev/xispa/bikalims/buildout-cache/eggs/robotsuite-1.3.3-py2.7.egg/robotsuite/__init__.py", line 360, in runTest
    assert last_status == 'PASS', last_message
AssertionError: ValueError: Element locator 'Method' did not match any elements.

    26/29 (89.7%)
==============================================================================
Test Bika Setup
==============================================================================
Repetitive Bika Setup stuff                                           | FAIL |
ValueError: Element locator 'xpath=//input[@item_title='Calculating Nothing']' did not match any elements.
------------------------------------------------------------------------------
Test Bika Setup                                                       | FAIL |
1 critical test, 0 passed, 1 failed
1 test total, 0 passed, 1 failed
==============================================================================
Output:  /home/jordi/dev/xispa/bikalims/zinstance/parts/test/test_bika_setup/Repetitive_Bika_Setup_stuff/output.xml
Log:     /home/jordi/dev/xispa/bikalims/zinstance/parts/test/test_bika_setup/Repetitive_Bika_Setup_stuff/log.html
Report:  /home/jordi/dev/xispa/bikalims/zinstance/parts/test/test_bika_setup/Repetitive_Bika_Setup_stuff/report.html



Failure in test Repetitive Bika Setup stuff (test_bika_setup.robot)
Traceback (most recent call last):
  File "/home/jordi/dev/xispa/bikalims/buildout-cache/eggs/unittest2-0.5.1-py2.7.egg/unittest2/case.py", line 340, in run
    testMethod()
  File "/home/jordi/dev/xispa/bikalims/buildout-cache/eggs/robotsuite-1.3.3-py2.7.egg/robotsuite/__init__.py", line 360, in runTest
    assert last_status == 'PASS', last_message
AssertionError: ValueError: Element locator 'xpath=//input[@item_title='Calculating Nothing']' did not match any elements.


  Ran 29 tests with 4 failures and 0 errors in 28 minutes 32.175 seconds.
Tearing down left over layers:
  Tear down bika.lims.testing.BikaTestingLayer:Robot in 0.000 seconds.
  Tear down plone.testing.z2.ZServer in 1.416 seconds.
  Tear down bika.lims.testing.BikaTestLayer in 0.021 seconds.
  Tear down plone.app.testing.layers.PloneFixture in 0.592 seconds.
  Tear down plone.testing.z2.Startup in 0.009 seconds.
  Tear down plone.testing.zca.LayerCleanup in 0.081 seconds.
Total: 45 tests, 4 failures, 0 errors in 29 minutes 59.331 seconds.
```

**... but if I run the failing tests individually...**


```
jordi@darwin:~/dev/xispa/bikalims/zinstance$ bin/test -m bika.lims -t test_BatchRunning bika.lims.testing.BikaTestingLayer:Robot tests:
  Set up plone.testing.zca.LayerCleanup in 0.000 seconds.
  Set up plone.testing.z2.Startup in 0.543 seconds.
  Set up plone.app.testing.layers.PloneFixture in 14.580 seconds.
  Set up bika.lims.testing.BikaTestLayer in 51.758 seconds.
  Set up plone.testing.z2.ZServer in 0.502 seconds.
  Set up bika.lims.testing.BikaTestingLayer:Robot in 0.000 seconds.
  Running:
    1/2 (50.0%)The following test left new threads behind:
Test Batch-AR (test_Batch.robot)
New thread(s): [<_DummyThread(Dummy-1, started daemon 140497728153344)>]

  Ran 2 tests with 0 failures and 0 errors in 3 minutes 31.707 seconds.
Tearing down left over layers:
  Tear down bika.lims.testing.BikaTestingLayer:Robot in 0.000 seconds.
  Tear down plone.testing.z2.ZServer in 1.466 seconds.
  Tear down bika.lims.testing.BikaTestLayer in 0.020 seconds.
  Tear down plone.app.testing.layers.PloneFixture in 0.121 seconds.
  Tear down plone.testing.z2.Startup in 0.004 seconds.
  Tear down plone.testing.zca.LayerCleanup in 0.008 seconds.


jordi@darwin:~/dev/xispa/bikalims/zinstance$ bin/test -m bika.lims -t test_RejectionWorkflow
Running bika.lims.testing.BikaTestingLayer:Robot tests:
  Set up plone.testing.zca.LayerCleanup in 0.000 seconds.
  Set up plone.testing.z2.Startup in 0.484 seconds.
  Set up plone.app.testing.layers.PloneFixture in 12.693 seconds.
  Set up bika.lims.testing.BikaTestLayer in 48.208 seconds.
  Set up plone.testing.z2.ZServer in 0.515 seconds.
  Set up bika.lims.testing.BikaTestingLayer:Robot in 0.000 seconds.
  Running:
    1/1 (100.0%)The following test left new threads behind:
Reject worksheet with regular blank control and duplicate analyses (test_RejectionWorkflow.robot)
New thread(s): [<_DummyThread(Dummy-1, started daemon 139677124757248)>]

  Ran 1 tests with 0 failures and 0 errors in 1 minutes 31.210 seconds.
Tearing down left over layers:
  Tear down bika.lims.testing.BikaTestingLayer:Robot in 0.000 seconds.
  Tear down plone.testing.z2.ZServer in 1.216 seconds.
  Tear down bika.lims.testing.BikaTestLayer in 0.020 seconds.
  Tear down plone.app.testing.layers.PloneFixture in 0.438 seconds.
  Tear down plone.testing.z2.Startup in 0.004 seconds.
  Tear down plone.testing.zca.LayerCleanup in 0.008 seconds.


jordi@darwin:~/dev/xispa/bikalims/zinstance$ bin/test -m bika.lims -t test_ARTemplates
Running bika.lims.testing.BikaTestingLayer:Robot tests:
  Set up plone.testing.zca.LayerCleanup in 0.000 seconds.
  Set up plone.testing.z2.Startup in 0.504 seconds.
  Set up plone.app.testing.layers.PloneFixture in 12.844 seconds.
  Set up bika.lims.testing.BikaTestLayer in 48.698 seconds.
  Set up plone.testing.z2.ZServer in 0.502 seconds.
  Set up bika.lims.testing.BikaTestingLayer:Robot in 0.000 seconds.
  Running:
    1/1 (100.0%)The following test left new threads behind:
Add an ARTemplate with Analysis Dependencies (test_ARTemplates.robot)
New thread(s): [<_DummyThread(Dummy-1, started daemon 140100736370432)>]

  Ran 1 tests with 0 failures and 0 errors in 32.022 seconds.
Tearing down left over layers:
  Tear down bika.lims.testing.BikaTestingLayer:Robot in 0.000 seconds.
  Tear down plone.testing.z2.ZServer in 1.215 seconds.
  Tear down bika.lims.testing.BikaTestLayer in 0.016 seconds.
  Tear down plone.app.testing.layers.PloneFixture in 0.048 seconds.
  Tear down plone.testing.z2.Startup in 0.004 seconds.
  Tear down plone.testing.zca.LayerCleanup in 0.008 seconds.


jordi@darwin:~/dev/xispa/bikalims/zinstance$ bin/test -m bika.lims -t test_bika_setup
Running bika.lims.testing.BikaTestingLayer:Robot tests:
  Set up plone.testing.zca.LayerCleanup in 0.000 seconds.
  Set up plone.testing.z2.Startup in 0.251 seconds.
  Set up plone.app.testing.layers.PloneFixture in 5.340 seconds.
  Set up bika.lims.testing.BikaTestLayer in 42.850 seconds.
  Set up plone.testing.z2.ZServer in 0.502 seconds.
  Set up bika.lims.testing.BikaTestingLayer:Robot in 0.000 seconds.
  Running:
    1/1 (100.0%)[ WARN ] Maintenance, Validations, CAlibrations, Certifications and Schedules not tested
[ WARN ] Can't select Reset using SESSION (breaks in zeo without sticky sessions)
The following test left new threads behind:
Repetitive Bika Setup stuff (test_bika_setup.robot)
New thread(s): [<_DummyThread(Dummy-1, started daemon 140658681431808)>]

  Ran 1 tests with 0 failures and 0 errors in 9 minutes 47.013 seconds.
Tearing down left over layers:
  Tear down bika.lims.testing.BikaTestingLayer:Robot in 0.000 seconds.
  Tear down plone.testing.z2.ZServer in 0.865 seconds.
  Tear down bika.lims.testing.BikaTestLayer in 0.017 seconds.
  Tear down plone.app.testing.layers.PloneFixture in 0.048 seconds.
  Tear down plone.testing.z2.Startup in 0.004 seconds.
  Tear down plone.testing.zca.LayerCleanup in 0.012 seconds.

```