Commit 04c50ab6 authored by Philippe Pepiot's avatar Philippe Pepiot
Browse files

[test] drop dependency on third party cubes

Drop dependency on cubicweb-file, cubicweb-localperms, cubicweb-tag and
cubicweb-comment for cubicweb.test and cubicweb.sobjects.test

Move cubicweb/test/data/libpython/cubicweb_* to cubicweb/test/data, so it's
included in PYTHONPATH.
Add missing parts of schema, entities, views, hooks that make tests pass.
parent 34c4157b1071
\ No newline at end of file
\ No newline at end of file
\ No newline at end of file
\ No newline at end of file
numversion = (1, 2, 3)
version = "1.2.3"
from cubicweb.entities import AnyEntity, fetch_config
class Card(AnyEntity):
__regid__ = 'Card'
rest_attr = 'wikiid'
fetch_attrs, cw_fetch_order = fetch_config(['title'])
def rest_path(self):
if self.wikiid:
return '%s/%s' % (str(self.e_schema).lower(),
self._cw.url_quote(self.wikiid, safe='/'))
return super(Card, self).rest_path()
from yams.buildobjs import EntityType, String, RichString
class Card(EntityType):
__permissions__ = {
'read': ('managers', 'users', 'guests'),
'add': ('managers', 'users'),
'delete': ('managers', 'owners'),
'update': ('managers', 'owners',),
title = String(required=True, fulltextindexed=True, maxsize=256)
synopsis = String(fulltextindexed=True, maxsize=512,
description=("an abstract for this card"))
content = RichString(fulltextindexed=True, internationalizable=True,
wikiid = String(maxsize=64, unique=True)
from yams.buildobjs import (EntityType, RelationType, SubjectRelation,
from cubicweb.schema import RRQLExpression
class Comment(EntityType):
"""a comment is a reply about another entity"""
__permissions__ = {
'read': ('managers', 'users', 'guests',),
'add': ('managers', 'users',),
'delete': ('managers', 'owners',),
'update': ('managers', 'owners',),
content = RichString(required=True, fulltextindexed=True)
comments = SubjectRelation('Comment', cardinality='1*', composite='object')
class comments(RelationType):
__permissions__ = {
'read': ('managers', 'users', 'guests'),
'add': ('managers', 'users',),
'delete': ('managers', RRQLExpression('S owned_by U'),),
inlined = True
composite = 'object'
cardinality = '1*'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment