def test_add_code(self): test_code = PermissionCode(name=u"测试操作", code=50) self.assertTrue(test_code.save()) self.assertIsNotNone(PermissionCode.query.filter_by(code=u'50').first())
def init_test_code_table(self): PermissionCode.init_data() self.assertIsNotNone(PermissionCode.query.filter_by(code=u'100').first()) self.assertIsNotNone(PermissionCode.query.filter_by(code=u'300').first())