Beispiel #1
0
 def test_create(self):
     user = factory.make_admin()
     handler = DHCPSnippetHandler(user, {})
     dhcp_snippet_name = factory.make_name('dhcp_snippet_name')
     handler.create({
         'name': dhcp_snippet_name,
         'value': factory.make_string(),
     })
     self.assertIsNotNone(DHCPSnippet.objects.get(name=dhcp_snippet_name))
Beispiel #2
0
 def test_create(self):
     user = factory.make_admin()
     handler = DHCPSnippetHandler(user, {}, None)
     dhcp_snippet_name = factory.make_name("dhcp_snippet_name")
     handler.create({
         "name": dhcp_snippet_name,
         "value": factory.make_string()
     })
     self.assertIsNotNone(DHCPSnippet.objects.get(name=dhcp_snippet_name))
     event = Event.objects.get(type__level=AUDIT)
     self.assertIsNotNone(event)
     self.assertEqual(event.description,
                      "Created DHCP snippet '%s'." % dhcp_snippet_name)
Beispiel #3
0
 def test_create(self):
     user = factory.make_admin()
     handler = DHCPSnippetHandler(user, {})
     dhcp_snippet_name = factory.make_name('dhcp_snippet_name')
     handler.create({
         'name': dhcp_snippet_name,
         'value': factory.make_string(),
     })
     self.assertIsNotNone(DHCPSnippet.objects.get(name=dhcp_snippet_name))
     event = Event.objects.get(type__level=AUDIT)
     self.assertIsNotNone(event)
     self.assertEqual(
         event.description, "DHCP snippet '%s'" % dhcp_snippet_name +
         " created by '%(username)s'.")