def setUp(self): super(MonitoringChecksTestCase, self).setUp() populate() self.host = Host.objects.create(name='localhost', ip='127.0.0.1') self.service_type = ServiceType.objects.get( name=ServiceType.TYPE_GEONODE) self.service = Service.objects.create( name=settings.MONITORING_SERVICE_NAME, host=self.host, service_type=self.service_type) self.metric = Metric.objects.get(name='request.count') self.user = '******' self.passwd = 'admin' self.u, _ = get_user_model().objects.get_or_create(username=self.user) self.u.is_active = True self.u.email = '*****@*****.**' self.u.set_password(self.passwd) self.u.save() self.user2 = 'test' self.passwd2 = 'test' self.u2, _ = get_user_model().objects.get_or_create( username=self.user2) self.u2.is_active = True self.u2.email = '*****@*****.**' self.u2.set_password(self.passwd2) self.u2.save()
def setUp(self): super(MonitoringChecksTestCase, self).setUp() populate() self.host, _ = Host.objects.get_or_create( name='localhost', ip='127.0.0.1') self.service_type = ServiceType.objects.get( name=ServiceType.TYPE_GEONODE) self.service, _ = Service.objects.get_or_create( name=settings.MONITORING_SERVICE_NAME, host=self.host, service_type=self.service_type) self.metric = Metric.objects.get(name='request.count') self.user = '******' self.passwd = 'admin' self.u, _ = get_user_model().objects.get_or_create(username=self.user) self.u.is_active = True self.u.email = '*****@*****.**' self.u.set_password(self.passwd) self.u.save() self.user2 = 'test' self.passwd2 = 'test' self.u2, _ = get_user_model().objects.get_or_create( username=self.user2) self.u2.is_active = True self.u2.email = '*****@*****.**' self.u2.set_password(self.passwd2) self.u2.save()
def setUp(self): create_models('layer') self.user = '******' self.passwd = 'admin' self.u, _ = get_user_model().objects.get_or_create(username=self.user) self.u.is_active = True self.u.email = '*****@*****.**' self.u.set_password(self.passwd) self.u.save() self.ua = ("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36" "(KHTML, like Gecko) Chrome/59.0.3071.47 Safari/537.36") populate() self.host = Host.objects.create(name='localhost', ip='127.0.0.1') self.service_type = ServiceType.objects.get(name=ServiceType.TYPE_GEONODE) self.service = Service.objects.create(name=settings.MONITORING_SERVICE_NAME, host=self.host, service_type=self.service_type)
def setUp(self): super(RequestsTestCase, self).setUp() self.user = '******' self.passwd = 'admin' self.u, _ = get_user_model().objects.get_or_create(username=self.user) self.u.is_active = True self.u.email = '*****@*****.**' self.u.set_password(self.passwd) self.u.save() self.ua = ("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36" "(KHTML, like Gecko) Chrome/59.0.3071.47 Safari/537.36") populate() self.host, _ = Host.objects.get_or_create( name='localhost', ip='127.0.0.1') self.service_type = ServiceType.objects.get( name=ServiceType.TYPE_GEONODE) self.service, _ = Service.objects.get_or_create( name=settings.MONITORING_SERVICE_NAME, host=self.host, service_type=self.service_type)
def run_setup_hooks(self, *args, **kwargs): if not has_notifications: log.warning("Monitoring requires notifications app to be enabled. " "Otherwise, no notifications will be send") populate()
def run_setup_hooks(*args, **kwargs): if not has_notifications: log.warning("Monitoring requires notifications app to be enabled. " "Otherwise, no notifications will be send") from geonode.contrib.monitoring.models import populate populate()