It just checks if the index page has a specific sentence. But at least it’s now possible to create tests.
		
			
				
	
	
		
			25 lines
		
	
	
		
			498 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			498 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| import pytest
 | |
| 
 | |
| import calsocial
 | |
| from calsocial.models import db
 | |
| 
 | |
| 
 | |
| @pytest.fixture
 | |
| def client():
 | |
|     calsocial.app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///'
 | |
|     calsocial.app.config['TESTING'] = True
 | |
|     client = calsocial.app.test_client()
 | |
| 
 | |
|     with calsocial.app.app_context():
 | |
|         db.create_all()
 | |
| 
 | |
|     yield client
 | |
| 
 | |
| 
 | |
| def test_index_no_login(client):
 | |
|     """Test the main page without logging in
 | |
|     """
 | |
| 
 | |
|     page = client.get('/')
 | |
|     assert b'Welcome to Calendar.social' in page.data
 |