Commit 3d94192d authored by Noé Gaumont's avatar Noé Gaumont 🐙
Browse files

Add a smoke test and remove automatic test

Automatic test were failing because of file entity were selected
and this entity does not support kwargs.
Replace these tests by a smoke test with a basic schema.
parent b13ddf344c72
from cubicweb_treeview.adapters import TVITreeAdapter
from cubicweb.predicates import is_instance
class NoteTreeViewAdapter(TVITreeAdapter):
__select__ = is_instance('Note')
from yams.buildobjs import (EntityType, SubjectRelation, String)
class Note(EntityType):
content = String()
has_note = SubjectRelation('Note')
......@@ -14,14 +14,23 @@
# You should have received a copy of the GNU Lesser General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
"""cubicweb-treeview automatic tests"""
from cubicweb.devtools.testlib import AutomaticWebTest
"""cubicweb-treeview smoke tests"""
from cubicweb.devtools.testlib import CubicWebTC
from mock import patch
class AutomaticWebTest(AutomaticWebTest):
'''provides `to_test_etypes` and/or `list_startup_views` implementation
to limit test scope
'''
class Treeview(CubicWebTC):
def test_works(self):
with self.admin_access.web_request() as req:
note = req.create_entity('Note', content=u'Title')
note.view("treeview")
@patch("cubicweb_treeview.views.treeview.TVDefaultTreeViewItemView.cell_call")
def test_overrides_DefaultTreeViewItemView(self, cell_call):
with self.admin_access.web_request() as req:
note = req.create_entity('Note', content=u'Title')
note.view("treeview")
self.assertTrue(cell_call.called)
if __name__ == '__main__':
......
......@@ -4,6 +4,7 @@ envlist = py27,py3,flake8,check-manifest
[testenv]
deps =
pytest
mock
commands =
{envpython} -m pytest {posargs:test}
......
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