You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
			
		
		
		
		
			
		
			
				
					
					
						
							29 lines
						
					
					
						
							727 B
						
					
					
				
			
		
		
	
	
							29 lines
						
					
					
						
							727 B
						
					
					
				| import pytest | |
| 
 | |
| from pyramid.httpexceptions import HTTPFound | |
| from pyramid.testing import DummyRequest | |
| 
 | |
| 
 | |
| from .. import app_config, dbsession, get_example_user  # noqa: F401 | |
| 
 | |
| 
 | |
| @pytest.mark.parametrize( | |
|     'user,location', | |
|     [(None, '/account/login'), ('someone', '/orders')] | |
|     ) | |
| def test_welcome(user, location): | |
|     ''' test redirects on web root ''' | |
|     from ordr.views.pages import welcome | |
| 
 | |
|     request = DummyRequest(user=user) | |
|     result = welcome(None, request) | |
| 
 | |
|     assert isinstance(result, HTTPFound) | |
|     assert result.location == f'http://example.com/{location}' | |
| 
 | |
| 
 | |
| def test_faq(): | |
|     ''' test the view for the faq page ''' | |
|     from ordr.views.pages import faq | |
|     result = faq(None, None) | |
|     assert result == {}
 | |
| 
 |