Defendants have appealed from a judgment ordering issuance of a peremptory writ of mandate and dismissing their cross-complaint for declaratory relief.1 By that judgment the trial court ordered defendants (a chartered city, and its mayor, city manager, council members and fire chief) to grant plaintiffs (an unincorporated union — all of the members of which are employees of defendant city's fire department — and its duly appointed representative) the right of self-organization and the right to "present grievances and recommendations regarding wages, salaries, hours and working conditions to the governing body of the Fire Department and to discuss the same with such governing body through such organizations." Defendants were further ordered to vacate and set aside certain policies, rules and regulations that will hereafter be mentioned.
Insofar as the judgment is predicated upon the constitutionality of Labor Code sections 1960 through 1963, and their applicability to a chartered city, the issues herein are identical to those discussed in the companion case of Professional Fire Fighters, Inc. v. City of Los Angeles, L.A. 27007, decided this day, ante, page 276 [32 Cal.Rptr. 830, 384 P.2d 158]. The same is true of the determination that mandate is a proper form of relief herein. The rules announced in that opinion are controlling here, and need not be repeated. The judgment in the instant case should be affirmed for all the reasons set forth as justification for reversal in the Los Angeles case.
There are, however, certain minor distinctions in the two cases, and the judgment herein contains certain language which should be modified. Those matters require further discussion.
The plaintiff union in this case is an unincorporated association, whereas its counterpart in Los Angeles was incorporated. The individual plaintiff in each case was both a union representative and an employee of defendant city's fire department.  Until recently, the fact that plaintiff union is unincorporated might have been urged as a basis for denying the union the right to sue on behalf of the class it is alleged to represent. Such contention is no longer available. (Daniels v. Sanitarium Assn., Inc., 59 Cal.2d 602 [30 Cal.Rptr. 828, 381 P.2d 652]; Marshall v. International Longshoremen's & Warehousemen's Union, 57 Cal.2d 781 [22 Cal.Rptr. 211, 371 P.2d 987].)  But defendants also urge that plaintiffs' capacity to sue (that is, their requisite beneficial interest in the cause of action) was made an issue of fact by reason of their answer which included a general denial of all of the facts pleaded in the petition for writ of mandate. They contend that there is no basis for the judgment because no evidence was offered in support of this material issue. The fact is that, although defendants' answer denied that all members of the union (as well as plaintiff Smith) were employees of the fire department, defendants affirmatively alleged such membership in their cross-complaint. The matter was then tried (as distinguished from the Los Angeles case, which was determined on motions for summary judgment), and during that trial neither court nor counsel appear to have expressed any doubt as to the truth of the allegations of the petition or of the cross-complaint. On this appeal defendants attack the judgment on the ground that it denies them the right to so plead inconsistent defenses. In other words, they are contending that the trial court had no power to assume the truth of the allegations of their cross-complaint, in the absence of proof, because of their general denial in their answer of the same allegations as they appeared in the pleadings of plaintiffs. The doctrine of "inconsistent defenses" is inapplicable. It applies to the right of the pleader to set forth inconsistent allegations at the time of pleading, and to offer proof thereof at the trial. Here defendants made the inconsistent allegations, but offered no proof in regard to either. The reporter's transcript indicates that the case was tried upon the theory that all members of plaintiff union, as well as plaintiff Smith, were and are members of defendant city's fire department. Nothing was stated by anyone during the trial to the contrary. The trial court assumed that the parties were in agreement as to this basic fact, and stated that nothing remained but questions of law. The parties submitted the matter on that basis. Defendants are estopped from challenging the fact at this late date. It follows that both plaintiffs had a beneficial interest in the cause of action, and were proper parties to represent the entire class of employees.
 Defendants also claim that there was no evidence on which to predicate a writ of mandate, commanding them to conform to the provisions of the Labor Code involved. Their argument is that the court should not resort to mandate in the absence of proof that they have disregarded in the past, or will in the future disregard the statutory provisions. While it may be true that no proof of such facts was presented by way of evidence, none was necessary. Plaintiffs' original petition contained, as exhibits, correspondence between plaintiffs' attorney and defendants' city manager whereby the former requested defendants' attitude in regard to Labor Code sections 1960-1963, and was advised by the latter that defendants intended to act according to the advice of their city attorney who held that "the law does not apply to charter cities and is therefore not binding on the City of Palo Alto nor any of its officers." While it may be true that the general denial included a denial of the authenticity of those exhibits, no point was made thereof at trial. Furthermore, defendants' own pleading (answer and return to petition for writ) incorporates three additional exhibits constituting correspondence between certain city officials and the minutes of the city council. These exhibits, the authenticity of which was never denied by plaintiffs, affirmatively show that: (1) for many years section 15 of the Rules and Regulations of the Palo Alto Fire Department prohibited members of the department from organizing or joining any labor union; (2) that rule was rescinded on the recommendation of the chief, after suit was filed herein, for the sole reason that it no longer reflected department policy, but that the chief still believed supervisory personnel should not be affiliated with any employee organization, and acting on such belief advised one captain to resign his membership in plaintiff union; (3) by motion duly adopted the defendant city council adopted a policy of refusing to recognize plaintiff union. In the face of such uncontroverted allegations of the defendants, no further evidence was required to prove that defendants did not intend to fully comply with the provisions of the Labor Code, and their present claim that the evidence was insufficient is without merit.
 Defendants next contend that even if the evidence was sufficient, the judgment is fatally defective in that the court failed to make any findings of fact. While it is true that section 1109 of the Code of Civil Procedure provides that the trial of a petition for writ shall follow the procedural provisions of the code, and that this has been held to include the necessity of findings of fact, the absence thereof does not affect the validity of the judgment so much as the right to appeal therefrom (Lassen v. City of Alameda, 150 Cal.App.2d 44, 48 [309 P.2d 520], quoting from Delany v. Toomey, 111 Cal.App.2d 570 [245 P.2d 26]). Moreover, it appears that formal findings were not required in the instant action. The trial court filed a written "Memorandum Opinion," setting forth the basis of its judgment. If there was any need to determine factual issues, that memorandum serves as informal findings. But this was not tried as a case in which there was any issue of fact. As noted above, the reporter's transcript shows that the trial judge stated (at the close of the testimony of the only witness) that he saw no issue of fact in the case, and intended to treat the entire matter as presenting only questions of law. There was no dissent to this statement, and the parties submitted the matter on that basis. Defendants offer no authority for the proposition that findings are required when there is no factual issue.
The defendants' cross-complaint for declaratory relief was dismissed by the trial court on its own motion. This was not error, although the particular form of the relief may be questioned.
[5a] The case was tried solely on the issues presented in the mandamus proceeding. The parties stipulated that the cross-complaint be held in abeyance pending the court's determination of the mandamus proceeding. The issues presented by the cross-complaint were not litigated.
Normally, of course, a person is entitled to a determination of the issues presented by the pleadings.  But, as to declaratory relief, section 1061 of the Code of Civil Procedure expressly provides that the trial court may refuse to grant declaratory relief "in any case where its declaration or determination is not necessary or proper at the time under all the circumstances." This is a discretionary power (Fairchild v. Bank of America, 192 Cal.App.2d 252, 260 [13 Cal.Rptr. 491]; Bard v. Standard Mortgage Corp., 119 Cal.App. 509, 512 [6 P.2d 582]) but should not be exercised in a case where a declaration of rights is clearly called for. (Weissman v. Lakewood Water & Power Co., 173 Cal.App.2d 652, 656 [343 P.2d 776]; Foster v. Masters Pontiac Co., 158 Cal.App.2d 481, 486 [322 P.2d 592].) [5b] In determining this question in a case where declaratory relief is sought by cross-complaint, it is important to consider whether the issues and evidence produced in the main case are substantially the same as would be produced under the cross-complaint (Weissman v. Lakewood Water & Power Co., supra, p. 656; Sattinger v. Newbauer, 123 Cal.App.2d 365, 369 [266 P.2d 586]). In the instant case the cross-complaint seeks a determination of the validity and constitutionality of section 1962 of the Labor Code, and if found to be valid and applicable to Palo Alto, a declaration of the rights and duties of the parties thereunder. These are substantially the same issues presented by the petition for the writ and the answer and return thereto. In the mandamus proceeding the validity and application of the Labor Code sections have been passed on. This opinion, in effect, constitutes a declaration of the rights and duties of defendants as they relate to the present controversy. The object of the prayer for declaratory relief set forth in the cross-complaint has been fully attained. Therefore, the trial court did not abuse its discretion in refusing declaratory relief.
 The form of relief — dismissal of the cross-complaint — was not proper. In Essick v. City of Los Angeles, 34 Cal.2d 614, 624 [213 P.2d 492], it was held that in such cases the trial court "should have entered its judgment decreeing expressly (as is implied by the judgment of dismissal)" that the party asking for the declaration is not entitled to that remedy. Therefore, the judgment in the instant case must be and is modified by striking from the last paragraph the words "that the cross-complaint filed herein by respondents [defendants], and each of them, as part of the return to the petition for writ of mandate, be, and the same is, dismissed," and there are inserted in lieu thereof the words: "that the respondents [defendants] are not entitled to declarations in their favor which they seek in their cross-complaint."
There is another minor correction that must be made in the judgment. The trial court correctly issued the writ of mandate directing plaintiffs to vacate and set aside their policies which fail to recognize the applicability of sections 1960-1963 of the Labor Code to the City of Palo Alto. The trial court went too far however in directing appellants to vacate and set aside the "rules and regulations of respondents [defendants] as reflected in Exhibits `A' and `B'." The judgment should be and is further modified by striking from the second paragraph thereof the words "as reflected in Exhibits `A' and `B'" and inserting in lieu thereof "which refuse and deny the applicability of Labor Code sections 1960 to 1963 inclusive to respondents [defendants]."
As so modified the judgment is affirmed, plaintiffs (respondents on the appeal) to recover costs.
Gibson, C.J., Traynor, J., Schauer, J., McComb, J., Tobriner, J., and Peek, J., concurred.