Changeset 1248
- Timestamp:
- 04/07/08 16:15:12 (8 months ago)
- Files:
-
- PleiadesEntity/trunk/tests/LocationViews.txt (modified) (1 diff)
- PleiadesEntity/trunk/tests/NameViews.txt (modified) (3 diffs)
- PleiadesEntity/trunk/tests/test_docfiles.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
PleiadesEntity/trunk/tests/LocationViews.txt
r615 r1248 26 26 the navtree. 27 27 28 Test login 29 30 >>> portal_url = self.portal.absolute_url() 31 32 The following is useful when writing and debugging testbrowser tests. It lets 33 us see all error messages in the error_log. 34 28 35 >>> self.portal.error_log._ignored_exceptions = () 29 36 >>> self.portal.left_slots = self.portal.right_slots = [] 30 37 31 Browse the Name 38 With that in place, we can go to the portal front page and log in. We will 39 do this using the default user from PloneTestCase: 40 41 >>> from Products.PloneTestCase.setup import portal_owner, default_password 42 >>> browser.open(portal_url) 43 44 We have the login portlet, so let's use that. 45 46 >>> browser.getControl(name='__ac_name').value = portal_owner 47 >>> browser.getControl(name='__ac_password').value = default_password 48 >>> browser.getControl(name='submit').click() 49 50 Here, we set the value of the fields on the login form and then simulate a 51 submit click. 52 53 We then test that we are still on the portal front page: 54 55 >>> browser.url == portal_url 56 True 57 58 And we ensure that we get the friendly logged-in message: 59 60 >>> "You are now logged in" in browser.contents 61 True 62 63 Browse the Location 32 64 33 65 >>> url = x.absolute_url() PleiadesEntity/trunk/tests/NameViews.txt
r746 r1248 34 34 the navtree. 35 35 36 Test login 37 38 >>> portal_url = self.portal.absolute_url() 39 40 The following is useful when writing and debugging testbrowser tests. It lets 41 us see all error messages in the error_log. 42 36 43 >>> self.portal.error_log._ignored_exceptions = () 37 44 >>> self.portal.left_slots = self.portal.right_slots = [] 45 46 With that in place, we can go to the portal front page and log in. We will 47 do this using the default user from PloneTestCase: 48 49 >>> from Products.PloneTestCase.setup import portal_owner, default_password 50 >>> browser.open(portal_url) 51 52 We have the login portlet, so let's use that. 53 54 >>> browser.getControl(name='__ac_name').value = portal_owner 55 >>> browser.getControl(name='__ac_password').value = default_password 56 >>> browser.getControl(name='submit').click() 57 58 Here, we set the value of the fields on the login form and then simulate a 59 submit click. 60 61 We then test that we are still on the portal front page: 62 63 >>> browser.url == portal_url 64 True 65 66 And we ensure that we get the friendly logged-in message: 67 68 >>> "You are now logged in" in browser.contents 69 True 38 70 39 71 Browse the Name … … 80 112 Edit the name, modify the attestation using legal characters and language to verify validation 81 113 82 >>> browser.getLink('Log in').click()83 >>> browser.getControl('Login Name').value = 'test_user_1_'84 >>> browser.getControl('Password').value = 'secret'85 >>> browser.getControl('Log in').click()86 114 >>> url = url + '/base_edit' 87 115 >>> browser.open(url) … … 105 133 >>> browser.contents 106 134 '...23 invalid character(s) in name Municipium Noxium Maximum...' 135 PleiadesEntity/trunk/tests/test_docfiles.py
r1247 r1248 13 13 ptc.installProduct('PleiadesEntity') 14 14 ptc.setupPloneSite(products=['Archetypes', 'ATVocabularyManager', 'Geographer', 'PleiadesEntity']) 15 16 #REQUIRE_TESTBROWSER = ['PublishGeoEntity.txt']17 15 18 16 optionflags = doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE | doctest.REPORT_ONLY_FIRST_FAILURE … … 44 42 optionflags=optionflags, 45 43 ), 46 #ztc.FunctionalDocFileSuite( 47 # 'browser.txt', 48 # package='Products.Geographer.tests', 49 # test_class=ptc.FunctionalTestCase, 50 # optionflags=optionflags, 51 # ) 44 ztc.FunctionalDocFileSuite( 45 'LocationViews.txt', 46 package='Products.PleiadesEntity.tests', 47 test_class=PleiadesEntityTestCase, 48 optionflags=optionflags, 49 ), 50 ztc.FunctionalDocFileSuite( 51 'NameViews.txt', 52 package='Products.PleiadesEntity.tests', 53 test_class=PleiadesEntityTestCase, 54 optionflags=optionflags, 55 ), 52 56 ]) 53 57 54 58 if __name__ == '__main__': 55 59 unittest.main(defaultTest='test_suite') 56 57 58 #def list_doctests():59 # return [filename for filename in60 # glob.glob(os.path.sep.join([TEST_HOME, '*.txt']))]61 62 #d#ef list_nontestbrowser_tests():63 # return [filename for filename in list_doctests()64 # if os.path.basename(filename) not in REQUIRE_TESTBROWSER]65 66 #def test_suite():67 #68 # # BBB: We can obviously remove this when testbrowser is Plone69 # # mainstream, read: with Five 1.4.70 # try:71 # import Products.Five.testbrowser72 # except ImportError:73 # print >> sys.stderr, ("WARNING: testbrowser not found - you probably"74 # "need to add Five 1.4 to the Products folder. "75 # "testbrowser tests skipped")76 # from Products.Five import zcml77 # from Products import PleiadesEntity78 # zcml.load_config('configure.zcml', package=PleiadesEntity)79 # filenames = list_nontestbrowser_tests()80 # else:81 # filenames = list_doctests()82 #83 # return unittest.TestSuite(84 # [Suite(os.path.basename(filename),85 # optionflags=OPTIONFLAGS,86 # package=TEST_PACKAGE,87 # globs=_testing.__dict__,88 # test_class=PloneTestCase.FunctionalTestCase)89 # for filename in filenames]90 # )
