Esempio n. 1
0
  def testSetsSettingsForUserCorrespondingToToken(self):
    settings = user_plugin.GUISettings(mode="ADVANCED", canary_mode=True)
    user = user_plugin.ApiGrrUser(settings=settings)

    self.handler.Handle(user, token=access_control.ACLToken(username=u"foo"))

    u = data_store.REL_DB.ReadGRRUser(u"foo")
    self.assertEqual(settings.mode, u.ui_mode)
    self.assertEqual(settings.canary_mode, u.canary_mode)
Esempio n. 2
0
    def testSetsSettingsForUserCorrespondingToToken(self):
        settings = user_plugin.GUISettings(mode="ADVANCED", canary_mode=True)
        user = user_plugin.ApiGrrUser(settings=settings)

        self.handler.Handle(
            user, context=api_call_context.ApiCallContext(username="******"))

        u = data_store.REL_DB.ReadGRRUser("foo")
        self.assertEqual(settings.mode, u.ui_mode)
        self.assertEqual(settings.canary_mode, u.canary_mode)