﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
36942	SimpleTestCase._remove_databases_failures() is not idempotent and crashes on complex MRO.	Michele Fiori	michele0303	"When using complex test inheritance (e.g., mixing multiple LiveServerTestCase subclasses or dynamic test class generation), the cleanup method 
{{{_remove_databases_failures}}} can be called in a state where database connection methods have already been unwrapped or were never wrapped for a specific alias.

Currently, the code assumes the wrapped attribute always exists: {{{setattr(connection, name, method.wrapped)}}}

This leads to an {{{AttributeError: 'function' object has no attribute 'wrapped'.}}}

The proposed fix adds a defensive {{{hasattr(method, ""wrapped"")}}} check to make the teardown process idempotent and robust against complex class hierarchies."	Bug	assigned	Testing framework	6.0	Normal			Michele Fiori	Unreviewed	1	0	0	0	0	0
