An Indian court has barred a leading news magazine here from writing about the business dealings of a political ally of Prime Minister Indira Gandhi.

The lower court injunction against the magazine India Today is the first case in India of an article being blocked before publication. It is viewed as a major test of the constitutional guarantees of freedom of the press in a country in which investigative reporting is in its infancy.

The court ban on the article, which was scheduled for publication in mid-February, assumes special significance because the press is undergoing a sustained assault from the Gandhi government, led by the prime minister, who has accused it of bias against her.

The case is before Subjudge Shiv Charan of New Delhi's lowest court. But his decision on whether or not to allow the magazine story on Charanjit Singh, a member of Parliament and a soft drink magnate, is likely to end up before the Supreme Court as India's version of the Pentagon Papers case in which the Nixon administration lost its attempt to stop The New York Times and The Washington Post from printing secret documents on the Vietnam War.

The Indian case, however, does not involve national security.

Singh argued in an affidavit that India Today wants to publish "a scandalous, concocted, incorrect, biased and politically motivated article . . . which will seriously damage, defame and harm" his reputation.

He appeared to base this view on a list of questions submitted to him by India Today correspondent Chaitanya Kalbag, who had been unable to see Singh to get his side of the story.

Such an attempt is unusual in Indian journalism, where the basic tenet of American reporting--to get both sides of a story--is rarely followed.

"The process of trying to do a fair job of reporting ironically has gotten us stuck in the courts," said India Today editor Aroon Purie.

The three pages of questions, included in the court documents, focused on charges raised by the opposition in Parliament over allowing Singh to build a luxury hotel connected with the French Meridien chain on a choice plot in downtown New Delhi allotted him by the Gandhi government.

Singh was a close associate of Gandhi's late son and political adviser, Sanjay, and won election to Parliament two years ago as a member of Gandhi's Congress-I Party.

Gandhi, in one of her most recent attacks, said, "The press is the opposition in India. They lead the opposition. It is not just reporting . . . Their reporting is absolutely baseless. They don't admit that anything good has happened."

The respected newspaper The Statesman replied with an editorial pointing out that Gandhi has received press "support and praise as few national leaders can aspire to."

"Is the press freedom Mrs. Gandhi has in mind merely freedom to conform, to applaud whatever she says or does, and even to praise her followers who are venal and brazen or incompetent and obsequious?" the editorial asked.

The Gandhi government's attitudes toward the press, articulated most frequently by the prime minister and her information minister, Vasant Sathe, are taken seriously in this country, where newspapers depend heavily on government advertising and where the government controls the import, price and distribution of newsprint.

A new crop of news magazines such as India Today and a few dailies, such as the Indian Express, have led Indian journalism's recent forays into investigative reporting. An Express series by associate editor Arun Shourie led to the resignation of Gandhi's chief minister for Maharashtra State, A. R. Antulay.

The suit by Charanjit Singh appears to have caught the rest of the Indian press unawares. None of them have asked to intervene in the case on the side of India Today. They are expected to join in, however, when the case moves to a higher court, as they did earlier this week when the Supreme Court barred the publication of remarks made before it by lawyers suggesting that a justice was biased in a different case.

The India Today case appears likely to break new legal ground in this country, where this type of court-ordered prior restraint has never before come up. The only similar case, according to legal experts here, involved a court order banning the second part of a series in a tabloid after the first article was found to be "scurrilous."