Use django integrated unit tests
This commit is contained in:
		
							
								
								
									
										22
									
								
								run_tests
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										22
									
								
								run_tests
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
#!/usr/bin/env python
 | 
			
		||||
import os, sys
 | 
			
		||||
import django
 | 
			
		||||
from django.conf import settings
 | 
			
		||||
 | 
			
		||||
import settings_tests
 | 
			
		||||
 | 
			
		||||
settings.configure(**settings_tests.__dict__)
 | 
			
		||||
django.setup()
 | 
			
		||||
 | 
			
		||||
try:
 | 
			
		||||
    # Django <= 1.8
 | 
			
		||||
    from django.test.simple import DjangoTestSuiteRunner
 | 
			
		||||
    test_runner = DjangoTestSuiteRunner(verbosity=1)
 | 
			
		||||
except ImportError:
 | 
			
		||||
    # Django >= 1.8
 | 
			
		||||
    from django.test.runner import DiscoverRunner
 | 
			
		||||
    test_runner = DiscoverRunner(verbosity=1)
 | 
			
		||||
 | 
			
		||||
failures = test_runner.run_tests(['cas_server'])
 | 
			
		||||
if failures:
 | 
			
		||||
    sys.exit(failures)
 | 
			
		||||
		Reference in New Issue
	
	Block a user