Esempio n. 1
0
 def get_context_data(self, **kwargs):
     context = super(TelemetryView, self).get_context_data(**kwargs)
     context.update({
         "opt_in": not telemetry.is_opt_out(),
         "is_grace": telemetry.is_in_grace_period(),
         "last_submission_time": telemetry.get_last_submission_time(),
         "submission_data": telemetry.get_telemetry_data(request=self.request, indent=2),
         "title": _("Telemetry")
     })
     return context
Esempio n. 2
0
 def get_context_data(self, **kwargs):
     context = super(TelemetryView, self).get_context_data(**kwargs)
     context.update({
         "opt_in":
         not telemetry.is_opt_out(),
         "is_grace":
         telemetry.is_in_grace_period(),
         "last_submission_time":
         telemetry.get_last_submission_time(),
         "submission_data":
         telemetry.get_telemetry_data(request=self.request, indent=2),
         "title":
         _("Telemetry")
     })
     return context
Esempio n. 3
0
def test_get_telemetry_data(rf):
    assert json.loads(get_telemetry_data(rf.get("/"))).get("host")
    assert not json.loads(get_telemetry_data(None)).get("host")
Esempio n. 4
0
def test_get_telemetry_data(rf):
    assert json.loads(get_telemetry_data(rf.get("/"))).get("host")
    assert not json.loads(get_telemetry_data(None)).get("host")