Exemple #1
0
 def test_device_actions_for_admin(self):
     handler = GeneralHandler(factory.make_admin(), {})
     self.assertItemsEqual(
         ['set-zone', 'delete'],
         [action['name'] for action in handler.device_actions({})])
Exemple #2
0
 def test_device_actions_for_non_admin(self):
     handler = GeneralHandler(factory.make_User(), {})
     self.assertEqual([], handler.device_actions({}))
Exemple #3
0
 def test_device_actions_for_non_admin(self):
     handler = GeneralHandler(factory.make_User(), {}, None)
     self.assertItemsEqual(
         ["set-zone", "delete"],
         [action["name"] for action in handler.device_actions({})],
     )