Back to index

plone3  3.1.7
Public Member Functions | Private Member Functions
CMFDefault.tests.test_NewsItem.NewsItemTests Class Reference
Inheritance diagram for CMFDefault.tests.test_NewsItem.NewsItemTests:
Inheritance graph
[legend]
Collaboration diagram for CMFDefault.tests.test_NewsItem.NewsItemTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_z3interfaces
def test_Empty_html
def test_Empty_stx
def test_Init_with_stx
def test_default_format

Private Member Functions

def _getTargetClass
def _makeOne

Detailed Description

Definition at line 29 of file test_NewsItem.py.


Member Function Documentation

Definition at line 31 of file test_NewsItem.py.

00031 
00032     def _getTargetClass(self):
00033         from Products.CMFDefault.NewsItem import NewsItem
00034 
00035         return NewsItem

def CMFDefault.tests.test_NewsItem.NewsItemTests._makeOne (   self,
  args,
  kw 
) [private]

Definition at line 36 of file test_NewsItem.py.

00036 
00037     def _makeOne(self, *args, **kw):
00038         return self._getTargetClass()(*args, **kw)

Definition at line 80 of file test_NewsItem.py.

00080 
00081     def test_default_format( self ):
00082         d = self._makeOne('foo', text='')
00083 
00084         self.assertEqual( d.Format(), 'text/plain' )
00085         self.assertEqual( d.text_format, 'structured-text' )
00086 

Definition at line 52 of file test_NewsItem.py.

00052 
00053     def test_Empty_html(self):
00054         d = self._makeOne('empty', text_format='html')
00055 
00056         self.assertEqual( d.Title(), '' )
00057         self.assertEqual( d.Description(), '' )
00058         self.assertEqual( d.Format(), 'text/html' )
00059         self.assertEqual( d.text_format, 'html' )
00060         self.assertEqual( d.text, '' )

Definition at line 61 of file test_NewsItem.py.

00061 
00062     def test_Empty_stx(self):
00063         d = self._makeOne('foo', text_format='structured-text')
00064 
00065         self.assertEqual( d.Title(), '' )
00066         self.assertEqual( d.Description(), '' )
00067         self.assertEqual( d.Format(), 'text/plain' )
00068         self.assertEqual( d.text_format, 'structured-text' )
00069         self.assertEqual( d.text, '' )

Definition at line 70 of file test_NewsItem.py.

00070 
00071     def test_Init_with_stx( self ):
00072         d = self._makeOne('foo', text_format='structured-text',
00073                           title='Foodoc')
00074 
00075         self.assertEqual( d.Title(), 'Foodoc' )
00076         self.assertEqual( d.Description(), '' )
00077         self.assertEqual( d.Format(), 'text/plain' )
00078         self.assertEqual( d.text_format, 'structured-text' )
00079         self.assertEqual( d.text, '' )

Definition at line 39 of file test_NewsItem.py.

00039 
00040     def test_z3interfaces(self):
00041         from zope.interface.verify import verifyClass
00042         from Products.CMFDefault.interfaces import IDocument
00043         from Products.CMFDefault.interfaces import IMutableDocument
00044         from Products.CMFDefault.interfaces import IMutableNewsItem
00045         from Products.CMFDefault.interfaces import INewsItem
00046 
00047         verifyClass(IDocument, self._getTargetClass())
00048         # XXX: different signature
00049         # verifyClass(IMutableDocument, self._getTargetClass())
00050         verifyClass(IMutableNewsItem, self._getTargetClass())
00051         verifyClass(INewsItem, self._getTargetClass())


The documentation for this class was generated from the following file: