"""Integration tests for generic views.""" import pytest from royalty_common.views import create_view from royalty_common.views import item_view from royalty_common.views import list_view def test_create_view(): """Test CreateView generic view.""" inst = create_view.CreateView() assert hasattr(inst, 'post') and callable(inst.post) with pytest.raises(NotImplementedError): inst.create_handler() def test_item_view(): """Test ItemView generic view.""" inst = item_view.ItemView() assert hasattr(inst, 'get') and callable(inst.get) assert hasattr(inst, 'delete') and callable(inst.delete) assert hasattr(inst, 'put') and callable(inst.put) with pytest.raises(NotImplementedError): inst.update_handler(None) def test_list_view(): """Test ListView generic view.""" inst = list_view.ListView() assert hasattr(inst, 'get') and callable(inst.get) assert hasattr(inst, 'get_page') and callable(inst.get_page)