# -*- coding: utf-8 -*-
#
# $Id: base.py 245805 2011-10-23 19:08:23Z amelung $
#
# Copyright © 2004-2011 Otto-von-Guericke-Universität Magdeburg
#
# This file is part of ECQuiz.
#
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# ECQuiz is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ECQuiz; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
"""Base class for integration tests, based on ZopeTestCase and PloneTestCase.
Note that importing this module has various side-effects: it registers a set of
products with Zope, and it sets up a sandbox Plone site with the appropriate
products installed.
"""
# Let Zope know about the products we require above and beyond a basic
# Plone install (PloneTestCase takes care of these).
# Import PloneTestCase - this registers more products with Zope as a side effect
# Set up a Plone site, and apply the membrane and borg extension profiles
# to make sure they are installed.
#setupPloneSite(extension_profiles=('membrane:default', 'borg:default'))
if getter_p:
prefix = 'get'
else:
prefix = 'set'
f(value)
return f()
for p, v in props_values:
"""Base class for integration tests for the 'ECQuiz' product.
This may provide specific set-up and tear-down operations, or
provide convenience methods.
"""
""" currently logged-in user must be manager level
"""
# Set up the test's properties
('allowRepetition', False),
('onePerPage', False),
('onePerPageNav', False),
('scoringFunction', 'cruel'),
#('gradingScale', ()),
('directions', 'Please answer these questions!'),
('randomOrder', False),
('numberOfRandomQuestions', 0),))
return dummy
""" currently logged-in user must be manager level
"""
# dummy = ECQuiz(oid='dummy')
# # put dummy in context of portal
# dummy = dummy.__of__(portal)
# portal.dummy = dummy
# dummy.initializeArchetype()
# return dummy
# Create an MC question
# Set up the question's properties
('randomOrder', False),
('numberOfRandomAnswers', 0),
('points', 666),
('tutorGraded', False),
))
# Create MC answers
):
# Set up the answer's properties
('correct', corr),
('answer', answ),
))
# publish the thing
return dummy
"""Base class for functional integration tests for the 'ECQuiz'
product. This may provide specific set-up and tear-down
operations, or provide convenience methods.
"""