- Writes tests for aircox streamer application; - Add test utilities in aircox Co-authored-by: bkfox <thomas bkfox net> Reviewed-on: #110
		
			
				
	
	
		
			19 lines
		
	
	
		
			652 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			652 B
		
	
	
	
		
			Python
		
	
	
	
	
	
from django.utils.translation import gettext_lazy as _
 | 
						|
from django.views.generic import TemplateView
 | 
						|
 | 
						|
from aircox.views.admin import AdminMixin
 | 
						|
from .controllers import streamers
 | 
						|
 | 
						|
 | 
						|
class StreamerAdminView(AdminMixin, TemplateView):
 | 
						|
    template_name = "aircox_streamer/streamer.html"
 | 
						|
    title = _("Streamer Monitor")
 | 
						|
    streamers = streamers
 | 
						|
 | 
						|
    def dispatch(self, *args, **kwargs):
 | 
						|
        # Note: this might raise concurrency racing problem with viewsets,
 | 
						|
        # since streamers.streamers is reset to a new dict. Still am i not
 | 
						|
        # sure, and needs analysis.
 | 
						|
        self.streamers.reset()
 | 
						|
        return super().dispatch(*args, **kwargs)
 |