Skip to content

Commit

Permalink
tests from workshop
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Solorio committed Nov 8, 2021
1 parent 841954b commit a07c73b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions app/dashboard/tests/models/test_bounty_fulfillment.py
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()

0 comments on commit a07c73b

Please sign in to comment.