Hi,
  I m trying to make my first content type with zope3. The code is
available there: http://github.com/toutpt/z3weblog.entry/tree

I m following the second edition of the book "web component developement
with zope3", i know this is not the last edition. So, i m making a
ISized component for my simple content type, with a simple unittest, but
now, i want to use zope.dublincore package and i get an error when i m
launch the tests:

=================
(zope3apps)tou...@linux-tggd:~/workspace/zope3apps/apps/prout> .bin/test
Running tests at level 1
Running unit tests:
  Running:
...

Error in test test_size_for_display
(z3weblog.entry.tests.test_size.EntrySizeTestCase)
Traceback (most recent call last):
  File
"/home/toutpt/outils/python_system/2.5.4/lib/python2.5/unittest.py",
line 260, in run
    testMethod()
  File
"/home/toutpt/workspace/zope3apps/apps/prout/src/z3weblog.entry/src/z3weblog/entry/tests/test_size.py",
line 21, in test_size_for_display
    msg = self.size.sizeForDisplay()
  File
"/home/toutpt/workspace/zope3apps/apps/prout/src/z3weblog.entry/src/z3weblog/entry/size.py",
line 24, in sizeForDisplay
    unit, chars = self.sizeForSorting()
  File
"/home/toutpt/workspace/zope3apps/apps/prout/src/z3weblog.entry/src/z3weblog/entry/size.py",
line 18, in sizeForSorting
    dc = dcI.IZopeDublinCore(self.context)
TypeError: ('Could not adapt', <z3weblog.entry.content.ZODBWeblogEntry
object at 0x839382c>, <InterfaceClass
zope.dublincore.interfaces.IZopeDublinCore>)

.

Error in test test_size_for_sorting
(z3weblog.entry.tests.test_size.EntrySizeTestCase)
Traceback (most recent call last):
  File
"/home/toutpt/outils/python_system/2.5.4/lib/python2.5/unittest.py",
line 260, in run
    testMethod()
  File
"/home/toutpt/workspace/zope3apps/apps/prout/src/z3weblog.entry/src/z3weblog/entry/tests/test_size.py",
line 16, in test_size_for_sorting
    unit, size = self.size.sizeForSorting()
  File
"/home/toutpt/workspace/zope3apps/apps/prout/src/z3weblog.entry/src/z3weblog/entry/size.py",
line 18, in sizeForSorting
    dc = dcI.IZopeDublinCore(self.context)
TypeError: ('Could not adapt', <z3weblog.entry.content.ZODBWeblogEntry
object at 0x839382c>, <InterfaceClass
zope.dublincore.interfaces.IZopeDublinCore>)


  Ran 4 tests with 0 failures and 2 errors in 0.007 seconds.

Tests with errors:
   test_size_for_display (z3weblog.entry.tests.test_size.EntrySizeTestCase)
   test_size_for_sorting (z3weblog.entry.tests.test_size.EntrySizeTestCase)

============

The trace back is very clear, the zope.dublincore components are not
loaded. The question is : what is the best way to load components in
unittests ? Do just i have to load the zcml of zope.dublincore, or do i
have to register only needed components, if so how can i do that ?

JeanMichel FRANCOIS
Makina-Corpus
begin:vcard
fn:JeanMichel FRANCOIS
n:FRANCOIS;JeanMichel
org:Makina-Corpus
adr;quoted-printable:;;44 boulevard des pas enchant=C3=A9s;Nantes;;44200;FRANCE
email;internet:jeanmichel.franc...@makina-corpus.com
title;quoted-printable:Ing=C3=A9nieur D=C3=A9veloppement
tel;work:0251798084
tel;home:0240133880
tel;cell:0675156788
url:www.makina-corpus.com
version:2.1
end:vcard

_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to