Back to index

plone3  3.1.7
test_templatemixin.py
Go to the documentation of this file.
00001 ################################################################################
00002 #
00003 # Copyright (c) 2002-2005, Benjamin Saller <bcsaller@ideasuite.com>, and
00004 #                              the respective authors. All rights reserved.
00005 # For a list of Archetypes contributors see docs/CREDITS.txt.
00006 #
00007 # Redistribution and use in source and binary forms, with or without
00008 # modification, are permitted provided that the following conditions are met:
00009 #
00010 # * Redistributions of source code must retain the above copyright notice, this
00011 #   list of conditions and the following disclaimer.
00012 # * Redistributions in binary form must reproduce the above copyright notice,
00013 #   this list of conditions and the following disclaimer in the documentation
00014 #   and/or other materials provided with the distribution.
00015 # * Neither the name of the author nor the names of its contributors may be used
00016 #   to endorse or promote products derived from this software without specific
00017 #   prior written permission.
00018 #
00019 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
00020 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00021 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
00022 # FOR A PARTICULAR PURPOSE.
00023 #
00024 ################################################################################
00025 
00026 from Products.Archetypes.atapi import *
00027 from Products.Archetypes.config import TOOL_NAME
00028 from Products.Archetypes.tests.atsitetestcase import ATSiteTestCase
00029 from Products.Archetypes.TemplateMixin import TemplateMixin
00030 from Products.CMFCore.utils import getToolByName
00031 
00032 class TemplateMixinTest(ATSiteTestCase):
00033 
00034     def test_isTemplateEnabled(self):
00035         at = getToolByName(self.portal, TOOL_NAME)
00036         self.failUnless(at.isTemplateEnabled(TemplateMixin))
00037 
00038     def test_isTemplateEnabledType(self):
00039         at = getToolByName(self.portal, TOOL_NAME)
00040         self.failUnless(at.isTemplateEnabled(dict(klass=TemplateMixin)))
00041 
00042 def test_suite():
00043     from unittest import TestSuite, makeSuite
00044     suite = TestSuite()
00045     suite.addTest(makeSuite(TemplateMixinTest))
00046     return suite