-
-
Notifications
You must be signed in to change notification settings - Fork 775
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kevin Solorio
committed
Nov 8, 2021
1 parent
841954b
commit a07c73b
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from attr import has | ||
import pytest | ||
|
||
from dashboard.models import BountyFulfillment | ||
from dashboard.tests.factories.fulfillment_factory import FulfillmentFactory | ||
from dashboard.tests.factories.bounty_factory import BountyFactory | ||
|
||
@pytest.mark.django_db | ||
class TestBountyFulfillmentProperties: | ||
def test_fulfillment_has_bounty(self): | ||
fulfillment = FulfillmentFactory() | ||
assert hasattr(fulfillment, 'bounty') | ||
|
||
def test_deleting_bounty_deletes_fulfillment(self): | ||
bounty = BountyFactory() | ||
fulfillment = FulfillmentFactory(bounty=bounty) | ||
|
||
bounty.delete() | ||
|
||
with pytest.raises(BountyFulfillment.DoesNotExist): | ||
fulfillment.refresh_from_db() |