def test_patch_entity(self):
        """Tests that an entity gets patched."""
        response = client.patch(
            f"/api/v2/entities/{self.entity1.id}",
            json={"entity": {"name": "ta2", "type": "threat-actor"}},
        )
        data = response.json()
        self.assertEqual(response.status_code, 200, data)
        self.assertEqual(data["name"], "ta2")
        self.assertEqual(data["type"], "threat-actor")
Tests that an entity gets patched.
tests/apiv2/entities.py