def METHOD_NAME(self):
    """Tests for search_view, the view to search for registered items."""
    self.login("awilliam")
    user = get_user_model().objects.get_or_create(username="awilliam")[0]
    user2 = get_user_model().objects.get_or_create(username="awilliam1")[0]
    # awilliam should be denied
    response = self.client.get(reverse("itemreg_search"))
    self.assertEqual(404, response.status_code)
    # Now, make awilliam part of the group
    group = Group.objects.get_or_create(name="admin_itemreg")[0]
    user.groups.add(group)
    user.save()
    # awilliam should now be able to load the search page
    response = self.client.get(reverse("itemreg_search"))
    self.assertEqual(200, response.status_code)
    # Now, add some items belonging to user2 (awiliam1)
    phone = PhoneRegistration.objects.create(user=user2, manufacturer="other", imei="351756051523999", description="A phone")
    calc = CalculatorRegistration.objects.create(user=user2, calc_type="ti84p", calc_serial="9999999", calc_id="999999")
    comp = ComputerRegistration.objects.create(user=user2, manufacturer="other", model="test", serial="999999999", screen_size=14)
    # Search for all items in the database
    response = self.client.get(reverse("itemreg_search"), data={"type": "all", "user": ""})
    self.assertEqual(200, response.status_code)
    self.assertIn(phone, response.context["results"]["phone"])
    self.assertIn(calc, response.context["results"]["calculator"])
    self.assertIn(comp, response.context["results"]["computer"])
    # Search by user
    response = self.client.get(reverse("itemreg_search"), data={"type": "all", "user": "awilliam1"})
    self.assertEqual(200, response.status_code)
    self.assertIn(phone, response.context["results"]["phone"])
    self.assertIn(calc, response.context["results"]["calculator"])
    self.assertIn(comp, response.context["results"]["computer"])
    # Search by phone IMEI
    response = self.client.get(reverse("itemreg_search"), data={"type": "phone", "imei": "351756051523999"})
    self.assertEqual(200, response.status_code)
    self.assertIn(phone, response.context["results"]["phone"])
    # Search by calculator serial
    response = self.client.get(reverse("itemreg_search"), data={"type": "calculator", "serial": "9999999"})
    self.assertEqual(200, response.status_code)
    self.assertIn(calc, response.context["results"]["calculator"])
    # Search by computer serial
    response = self.client.get(reverse("itemreg_search"), data={"type": "computer", "serial": "999999999"})
    self.assertEqual(200, response.status_code)
    self.assertIn(comp, response.context["results"]["computer"])