[Zope3-checkins] CVS: Zope3/src/zope/app/dublincore/tests - test_creatorannotator.py:1.5

Tom Cameron tom@mooball.com
Fri, 11 Jul 2003 04:33:06 -0400


Update of /cvs-repository/Zope3/src/zope/app/dublincore/tests
In directory cvs.zope.org:/tmp/cvs-serv7081

Modified Files:
	test_creatorannotator.py 
Log Message:

Added test to check that creators are not duplicated when they do multiple edits.



=== Zope3/src/zope/app/dublincore/tests/test_creatorannotator.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/dublincore/tests/test_creatorannotator.py:1.4	Fri Jun  6 17:21:46 2003
+++ Zope3/src/zope/app/dublincore/tests/test_creatorannotator.py	Fri Jul 11 04:33:00 2003
@@ -111,11 +111,20 @@
 
         self.failIf(len(data.creators) != 1)
         self.failUnless(bad_author.getId() in data.creators)
-        
+
         # Now let the good edit it
         security = newSecurityManager(good_author)
         CreatorAnnotator.notify(event)
-        
+
+        self.failIf(len(data.creators) != 2)
+        self.failUnless(good_author.getId() in data.creators)
+        self.failUnless(bad_author.getId() in data.creators)
+
+        # Let the bad edit it again
+        security = newSecurityManager(bad_author)
+        CreatorAnnotator.notify(event)
+
+	# Check that the bad author hasn't been added twice.
         self.failIf(len(data.creators) != 2)
         self.failUnless(good_author.getId() in data.creators)
         self.failUnless(bad_author.getId() in data.creators)