plone.app.discussion/plone/app/discussion/tests/collection-integration-test.txt
esteele 98f1f3d6a4 Move portal_properties settings to configuration registry
commit b13db31e3c55fd5ed9320e9d0c93aea48366c883
Author: esteele <eric@esteele.net>
Date:   Fri Sep 18 10:14:56 2015 +0200

    Remove pdb.

commit 6b3e591583146ca661556ef50cafd02f62c79d46
Author: esteele <eric@esteele.net>
Date:   Fri Sep 18 09:50:06 2015 +0200

    Fix registry id

commit 9dfce9a739496b6023f93376535dccc9a9310517
Author: esteele <eric@esteele.net>
Date:   Thu Sep 17 18:34:42 2015 +0200

    Use registry lookup for types_use_view_action_in_listings
2015-09-20 17:31:55 +02:00

93 lines
3.9 KiB
Plaintext

XXX: This functional test part has been removed due to the removal of
ATContentTypes from PLONE_FIXTURE. We have to rewrite this test as a robot
test because the dexterity collections do not work without js.
List comments in a collection
-----------------------------
Create a collection.
>>> from plone.app.testing import setRoles
>>> from plone.app.testing import TEST_USER_NAME
>>> setRoles(portal, 'manager', ['Manager'])
>>> browser.open(portal.absolute_url())
>>> from plone.app.discussion.testing import COLLECTION_TYPE
>>> browser.getLink(url='++add++' + COLLECTION_TYPE).click()
>>> open('/tmp/testbrowser.html', 'w').write(browser.contents)
>>> browser.getControl('form.widgets.IDublinCore.title').value = 'Foo Comment Collection'
>>> browser.getControl('Save').click()
>>> print browser.contents
<...Changes saved...
>>> topic_url = browser.url
Set the collection criteria.
>>> browser.open(topic_url + "/edit")
>>> if COLLECTION_TYPE == "Collection":
... browser.getControl(name="addindex").value = ['portal_type']
... browser.getControl(name="form.button.addcriteria").click()
... browser.getControl(name="addoperator").value = ['plone.app.querystring.operation.selection.is']
... browser.getControl(name="form.button.addcriteria").click()
... browser.getControl(name="query.v:records:list").value = ["Discussion Item"]
... browser.getControl(name="form.button.save").click()
... else:
... browser.getLink('Criteria').click()
... browser.getControl('Item Type', index=0).selected = True
... browser.getControl('Select content types').selected = True
... browser.getControl('Add criteria').click()
... browser.getControl('Comment').selected = True
... browser.getControl('Save', index=0).click()
>>> print browser.contents
<...Changes saved...
View the collection listing.
>>> browser.getLink('View').click()
>>> browser.getLink('admin on Doc1', index=0)
<Link text='admin on Doc1' url='http://nohost/plone/doc1/++conversation++default/...'>
>>> browser.getLink('admin on Doc1', index=1)
<Link text='admin on Doc1' url='http://nohost/plone/doc1/++conversation++default/...'>
>>> browser.getLink('Anonymous on Doc1', index=0)
<Link text='Anonymous on Doc1' url='http://nohost/plone/doc1/++conversation++default/...'>
>>> browser.getLink('Anonymous on Doc1', index=1)
<Link text='Anonymous on Doc1' url='http://nohost/plone/doc1/++conversation++default/...'>
>>> browser.getLink(tarek_fullname + ' on Doc1')
<Link text='Tarek Ziad\xc3\xa9 on Doc1' url='http://nohost/plone/doc1/++conversation++default/...'>
>>> browser.getLink(jim_fullname + ' on Doc1')
<Link text='Jim Fult\xc3\xb8rn on Doc1' url='http://nohost/plone/doc1/++conversation++default/...'>
Comments are unindexed when the content is deleted
--------------------------------------------------
Delete the commented content.
>>> browser.open(urldoc1)
>>> browser.getLink('Delete').click()
>>> browser.getControl('Delete').click()
>>> print browser.contents
<...Doc1 has been deleted...
The comments are no longer in the catalog.
>>> browser.open(topic_url)
>>> browser.getLink('admin on Doc1', index=0)
Traceback (most recent call last):
LinkNotFoundError
>>> browser.getLink('admin on Doc1', index=1)
Traceback (most recent call last):
LinkNotFoundError
>>> browser.getLink('Anonymous on Doc1', index=0)
Traceback (most recent call last):
LinkNotFoundError
>>> browser.getLink('Anonymous on Doc1', index=1)
Traceback (most recent call last):
LinkNotFoundError
>>> browser.getLink(tarek_fullname + ' on Doc1')
Traceback (most recent call last):
LinkNotFoundError
>>> browser.getLink(jim_fullname + ' on Doc1')
Traceback (most recent call last):
LinkNotFoundError