[Zope-CMF] Duplicate test in CMFDefault.browser.test_ursa?

Tres Seaver tseaver at palladion.com
Sat Apr 3 13:47:43 EDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Charlie Clark wrote:
> Hi,
> 
> I've started working on some tests for a browser view and was looking at  
> the ursa globals tests for inspiration. It looks to me that there is a  
> duplicate test method
> 
> li. 278ff:
> 
>      def test_status_message_missing(self):
>          view = self._makeOne()
>          view.request.form = {}
>          self.assertEqual(view.status_message, None)
> 
>      def test_status_message_missing(self):
>          view = self._makeOne()
>          view.request.form = {'portal_status_message': 'FOO'}
>          self.assertEqual(view.status_message, 'FOO')
> 
> I think the second method should probably be called test_status_message.

Sounds right.  I'm probably the guilty part here (or at least those look
like my style of testing ;).

> Do duplicate method names in tests mean that only one of the tests will  
> run?

Yes:  Python doesn't treat such cases as errors:  it (silently) replaces
the originally-bound name with a new binding.


Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAku3fz8ACgkQ+gerLs4ltQ4VLQCgjav25c2Ed3UHuzBFh0DiLYQD
YH4AoJ/k1HPkNlHx0bohKjNd0zoiGBop
=FlK0
-----END PGP SIGNATURE-----



More information about the Zope-CMF mailing list