Add 'fake_error' view to test exception handling.
This commit is contained in:
		
							parent
							
								
									c6ca64574b
								
							
						
					
					
						commit
						be41d0bb1e
					
				
					 3 changed files with 23 additions and 4 deletions
				
			
		| 
						 | 
					@ -25,8 +25,10 @@
 | 
				
			||||||
Pyramid Views
 | 
					Pyramid Views
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from .core import *
 | 
					from tailbone.views.core import View
 | 
				
			||||||
from .grids import *
 | 
					from tailbone.views.grids import (
 | 
				
			||||||
 | 
					    GridView, AlchemyGridView, SortableAlchemyGridView,
 | 
				
			||||||
 | 
					    PagedAlchemyGridView, SearchableAlchemyGridView)
 | 
				
			||||||
from .crud import *
 | 
					from .crud import *
 | 
				
			||||||
from tailbone.views.autocomplete import AutocompleteView
 | 
					from tailbone.views.autocomplete import AutocompleteView
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -49,6 +51,8 @@ def includeme(config):
 | 
				
			||||||
    config.add_view(home, route_name='home',
 | 
					    config.add_view(home, route_name='home',
 | 
				
			||||||
                    renderer='/home.mako')
 | 
					                    renderer='/home.mako')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    config.include('tailbone.views.core')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    config.include('tailbone.views.auth')
 | 
					    config.include('tailbone.views.auth')
 | 
				
			||||||
    config.include('tailbone.views.batches')
 | 
					    config.include('tailbone.views.batches')
 | 
				
			||||||
    config.include('tailbone.views.brands')
 | 
					    config.include('tailbone.views.brands')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -37,3 +37,16 @@ class View(object):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __init__(self, request):
 | 
					    def __init__(self, request):
 | 
				
			||||||
        self.request = request
 | 
					        self.request = request
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def fake_error(request):
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					    View which raises a fake error, to test exception handling.
 | 
				
			||||||
 | 
					    """
 | 
				
			||||||
 | 
					    raise Exception("Fake error, to test exception handling.")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def includeme(config):
 | 
				
			||||||
 | 
					    config.add_route('fake_error', '/fake-error')
 | 
				
			||||||
 | 
					    config.add_view(fake_error, route_name='fake_error',
 | 
				
			||||||
 | 
					                    permission='admin')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -26,5 +26,7 @@
 | 
				
			||||||
Grid Views
 | 
					Grid Views
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from .core import *
 | 
					from tailbone.views.grids.core import GridView
 | 
				
			||||||
from .alchemy import *
 | 
					from tailbone.views.grids.alchemy import (
 | 
				
			||||||
 | 
					    AlchemyGridView, SortableAlchemyGridView,
 | 
				
			||||||
 | 
					    PagedAlchemyGridView, SearchableAlchemyGridView)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue