The office of the mayor, Mahmadsaid Ubaidulloev, has said that any imam who fails the exam will lose his post.
The head of the religious-affairs department in the Dushanbe mayor's office, Shamsiddin Nuriddinov, told RFE/RL that mosque leaders who fail to pass the exam will be sacked and replaced with other clerics.
Nuriddinov says Tajikistan's Council of Clerics has set up a special commission that is expected to complete the tests by the end of August.
"The officials from the city government and Dushanbe districts might also take part in the exam, if the Council of Clerics requires them to do so," Nuriddinov says.
Dushanbe authorities cite complaints from city residents about their local imams' lack of religious knowledge and competence.
But some imams say the test is yet another way for the government of a staunchly traditional, and predominantly Muslim, society to pressure religious institutions.
There are some 300 mosques in Dushanbe. Most of the buildings are used as community centers for many types of social gatherings, as well as for prayers.
Habibkhon Azamkhonov is the imam of Dushanbe's Sari Osiyo mosque. He calls the whole idea of forcing imams to pass a test an insult to him and his fellow clerics.
"I can't accept it. I've been working as an imam for 30 years," Azamkhonov says. "People felt very uncomfortable about this decision. This was supposed to be a democratic [society], but pressures are increasing."
It is not the first time mosques have come under government scrutiny in Tajikistan. Authorities have closed several Dushanbe mosques in the last three years, after criticizing them for operating without registrations. At the same time, all imams in Dushanbe and other cities were told they were no longer allowed to use loudspeakers to call the faithful to prayer (azaan).
The term "mosque" is sometimes used loosely in Tajikistan, with communal venues acquiring the label. Some clerics, in turn, have sought to appropriate such places for their own preaching and prayer groups.
An unregistered "mosque" in Dushanbe's Sino district that was destroyed by authoritiesin late July (RFE/RL)
Last week, two mosques were destroyed in Dushanbe's Sino district for operating without a license.
Imams, whose "job description" includes leading people during the prayers, often gain broad influence among the locals -- particularly since so many people gather at mosques at least once a day.
Attendees frequently stay on after evening prayers to discuss religious and social issues with imams.
Azamkhonov says such discussions are the real target of the mayor's decision to impose the religious tests.
He says the government wants to replace some clerics with others who are regarded as more loyal, or with close ties, to the authorities.
Some imams who have ventured beyond religious or social issues during such conversations have come under government and other official scrutiny.
Nuriddin Qahhorov, a prominent imam in a Dushanbe suburb known as Vahdat, is widely regarded as a critic of the government, and he has come under pressure in the past month.
In May, the State Committee for National Security confiscated recordings of Qahhorov's conversations from stores. Committee officials said the imam's statements posed a threat to Tajikistan's stability.
Some Dushanbe residents say imams with sufficient religious knowledge have nothing to fear from the compulsory testing. But official involvement in nonstate affairs raises suspicion in a country like Tajikistan, where the perception is widespread of corruption and bribery in exchange for official sinecure.
But 32-year-old Abdullo Naimov is critical of officials, saying it is an attempt to "sell" posts. "In our society, people struggle a lot to get any position, because there are very few jobs for people to earn a decent income for themselves and their families," Naimov says.
It remains unclear what questions the Dushanbe imams will be asked in the tests, which have already been postponed twice since they were announced in late July.
(RFE/RL's Tajik Service correspondent Mirzo Salimov contributed to this report.)