In a proceeding under the provisions of this article, a tenant against whom a petition has been brought may assert any and all defenses which might be raised in an action for ejectment or an action for unlawful detainer.