def test_patch_entity_type_mismatch(self):
        """Tests that an entity gets patched."""
        response = client.patch(
            f"/api/v2/entities/{self.entity1.id}",
            json={"entity": {"name": "ta2", "type": "malware"}},
        )
        data = response.json()
        self.assertEqual(response.status_code, 400, data)
        self.assertEqual(
            data["detail"],
            f"Entity {self.entity1.id} type mismatch. Provided 'malware'. Expected 'threat-actor'",
        )
Tests that an entity gets patched.
tests/apiv2/entities.py