def do_get_dependencies(self): try: self.language = content.Language(id=u'xx', name=u'test_lang') DBSession.add(self.language) DBSession.flush() return dict(lang=self.language.id, ) except: DBSession.rollback() raise
def do_get_dependencies(self): try: self.language = content.Language(id=u'xx', name=u'test_lang') DBSession.add(self.language) DBSession.flush() return dict(lang=self.language.id, ) except: DBSession.rollback() raise
def setUp(self): """Prepare model test fixture.""" try: new_attrs = {} new_attrs.update(self.attrs) new_attrs.update(self.do_get_dependencies()) self.obj = self.klass(**new_attrs) DBSession.add(self.obj) DBSession.flush() return self.obj except: DBSession.rollback() raise
def do_get_dependencies(self): try: self.user = auth.User(user_name=u'test_user') DBSession.add(self.user) self.language = content.Language(id=u'xx', name=u'test_lang') DBSession.add(self.language) self.category = content.Category(u'test category', u'xx') DBSession.add(self.category) DBSession.flush() return dict(title=u"A test article!", category=self.category, user=self.user, #language=self.language, lang=self.language.id, text = u"random text" ) except: DBSession.rollback() raise
def do_get_dependencies(self): try: self.user = auth.User(user_name=u'test_user') DBSession.add(self.user) self.language = content.Language(id=u'xx', name=u'test_lang') DBSession.add(self.language) self.category = content.Category(u'test category', u'xx') DBSession.add(self.category) DBSession.flush() return dict( title=u"A test article!", category=self.category, user=self.user, #language=self.language, lang=self.language.id, text=u"random text") except: DBSession.rollback() raise
def do_get_dependencies(self): try: user = auth.User(user_name=u'test_user') DBSession.add(user) language = content.Language(id=u'xx', name=u'test_lang') DBSession.add(language) self.media = content.Media(u'image', u'test_image', u'test.png', user, u'xx') DBSession.add(self.media) self.link = content.Link(u'test_link', u'http://example.com', user, u'xx') DBSession.add(self.link) DBSession.flush() return dict( media=self.media, link=self.link, ) except: DBSession.rollback() raise
def tearDown(self): """Finish model test fixture.""" DBSession.rollback()