tailbone/tests/__init__.py
Lance Edgar a6ce5eb21d feat: refactor forms/grids/views/templates per wuttaweb compat
this starts to get things more aligned between wuttaweb and tailbone.
the use case in mind so far is for a wuttaweb view to be included in a
tailbone app.

form and grid classes now have some new methods to match wuttaweb, so
templates call the shared method names where possible.

templates can no longer assume they have tailbone-native master view,
form, grid etc. so must inspect context more closely in some cases.
2024-08-15 15:49:54 -05:00

33 lines
634 B
Python

import unittest
from mock import Mock
from pyramid import testing
class TestCase(unittest.TestCase):
"""
Base class for all test suites.
"""
def setUp(self):
self.config = testing.setUp()
def tearDown(self):
testing.tearDown()
def mock_query():
"""
Mock object used to simulate a ``sqlalchemy.Query`` instance.
"""
query = Mock()
query.return_value = query
query.outerjoin.return_value = query
query.join.return_value = query
query.filter.return_value = query
query.distinct.return_value = query
query.order_by.return_value = query
return query