diff --git a/faucet/test.py b/faucet/test.py index 8e5f5b9e..6405e210 100644 --- a/faucet/test.py +++ b/faucet/test.py @@ -657,6 +657,8 @@ def setUp(self) -> None: name="Test Wallet", private_key=test_wallet_key ) + self.test_chain = create_test_chain(self.wallet) + self.optimism = Chain.objects.create( chain_name="Optimism", native_currency_name="ETH", @@ -679,6 +681,22 @@ def setUp(self) -> None: ) self.client.force_authenticate(user=self.user_profile.user) + def test_optimism_donation_contraint(self): + constraint = OptimismDonationConstraint(self.user_profile) + self.assertFalse(constraint.is_observed()) + DonationReceipt.objects.create( + user_profile=self.user_profile, + tx_hash = "0x0", + chain = self.test_chain + ) + self.assertFalse(constraint.is_observed()) + DonationReceipt.objects.create( + user_profile=self.user_profile, + tx_hash = "0x0", + chain = self.optimism + ) + self.assertTrue(constraint.is_observed()) + def test_optimism_claiming_gas_contraint(self): constraint = OptimismClaimingGasConstraint(self.user_profile) self.assertTrue(constraint.is_observed())