r13468 - Products.Archetypes/trunk/Products/Archetypes/tests

"Maurits van Rees" <[email protected]>
Newsgroups gmane.comp.web.zope.plone.archetypes.cvs
Message-ID <[email protected]>
Author: maurits
Date: Thu Feb 10 22:58:01 2011
New Revision: 13468

Modified:
   Products.Archetypes/trunk/Products/Archetypes/tests/test_referenceable.py
Log:
Fixed spurious test failure due to undefined order in test_back_relationships.

Modified: Products.Archetypes/trunk/Products/Archetypes/tests/test_referenceable.py
==============================================================================
--- Products.Archetypes/trunk/Products/Archetypes/tests/test_referenceable.py	(original)
+++ Products.Archetypes/trunk/Products/Archetypes/tests/test_referenceable.py	Thu Feb 10 22:58:01 2011
@@ -376,7 +376,11 @@
         brels = account.getBRelationships()
         self.assertEquals(brels, ['From'])
         brefs = account.getBRefs('From')
-        self.assertEquals(brefs, [payment, payment2])
+        # The order is not defined, which can lead to spurious test
+        # failures, but we do not care about the order.
+        self.assertEquals(len(brefs), 2)
+        self.failUnless(payment in brefs)
+        self.failUnless(payment2 in brefs)
 
         brels = payment.getBRelationships()
         self.assertEquals(brels, ['Owns'])

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.