The Heights - 7:131
"When good came to them, they used to say: "We deserved it", and when evil touched them, they used to accuse Moses and his companions of bad luck. Indeed, their bad luck is decided by Allah. But most of them do not know."
In the context of verses 130, 131...135; Our Lord tests societies with good deeds and evil deeds so that they may correct themselves and turn:
The Companies/39:49
"When an evil touches a man, he calls out to Us; but when We bestow on him a blessing, he says: "This has been given to me because of my knowledge". Indeed it is a test, but many do not know"
The Repentance/9:126
Do they not see that they are tested with calamities once or twice every year, yet they neither repent nor take admonition?
The Romans/30:41
Calamities spread on land and sea because of what the people have done with their hands. So He makes them taste some of what they used to do in order that they may turn back (from evil).
The Cattle/6:42
And We sent messengers to the people before you, and We tested them with hardship and distress so that they might supplicate.
The Cattle/6:43
If only they had supplicated when We afflicted them! But their hearts hardened, and Satan made their deeds appear to them as adornment.
The Heights/7:94
Whenever We sent a messenger to a land, We afflicted its people with hardship and distress so that they might beg.
The Believers/23:76
Even though We punished them, they did not submit to their Lord, nor did they supplicate.
The Heights/7:95
"Then We replaced evil with good. But they lost their understanding: They said: "Distress and prosperity touched our ancestors also". So We seized them suddenly without their knowledge."
Yaseen/36:17
Our duty is only to announce clearly.
Yaseen/36:18
"They said, "We have been jinxed because of you. If you do not cease, we will stone you and a painful punishment will touch you from us."
Yaseen/36:19
"They said, "It is because of you that you are jinxed. Is it because you have been warned? You are indeed a transgressing people."
The Ants/27:47
"They said, "You and those with you have jinxed us."He said, "Your bad luck is from Allah. Surely you are a people who are put to a test."
The Heights/7:130
And We sentenced the party of Pharaoh to years of drought and famine so that they might be admonished.
The Heights/7:131
"When good came to them, they used to say: "We deserved it", and when evil touched them, they used to accuse Moses and his companions of bad luck. Indeed, their bad luck is decided by Allah. But most of them do not know."
The Heights/7:132
"They said: "No matter how many miracles (signs) you bring to bewitch us, we will not believe you"."
The Heights/7:133
We sent upon them signs such as the flood, locusts, vermin, frogs and blood, but they continued to be arrogant and became a guilty people.
The Heights/7:134
"Whenever a calamity befell them, they said, "O Moses, invoke your Lord for His promise to you. If you deliver us from this calamity, we will believe in you and send the Children of Israel with you."
The Heights/7:136
So We took vengeance on them and drowned them in the sea because they denied Our Verses and paid no heed.