def test_model_extension():
 class DummyModelExtension(ModelExtension, ):
  'Simplest instance of ModelExtension'
 class DummyModel(Model, ):
  'Simplest instance of Model'
 extensions = DummyModelExtension()
 try:
  '\n        This should cause an assertion error for passing a tuple instead of\n        a list\n        '
  model = DummyModel(extensions=extensions)
 except AssertionError:
  pass
 extensions = [DummyModelExtension(), None]
 try:
  '\n        This should cause an assertion error for passing a list where each\n        element is not an instance of ModelExtension\n        '
  model = DummyModel(extensions=extensions)
 except AssertionError:
  pass
 extensions = []
 for i in xrange(3):
  extensions.append(DummyModelExtension())
 '\n    This should not cause an assertion\n    '
 model = DummyModel(extensions=extensions)

def test_model_extension ( ) : class DummyModelExtension ( ModelExtension , ) : class DummyModel ( Model , ) : extensions = DummyModelExtension ( ) try : model = DummyModel ( extensions = extensions ) except AssertionError : pass extensions = [ DummyModelExtension ( ) , None ] try : model = DummyModel ( extensions = extensions ) except AssertionError : pass extensions = [ ] for i in xrange ( 3 ) : extensions . append ( DummyModelExtension ( ) ) '\n    This should not cause an assertion\n    ' model = DummyModel ( extensions = extensions )
test that the base class model passes tests when given a list of modelextension instances .