-
Notifications
You must be signed in to change notification settings - Fork 286
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
Showing
6 changed files
with
58 additions
and
3 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
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
|
||
from core.models import Event | ||
from organize.constants import DEPLOYED, ON_HOLD, REJECTED | ||
from organize.models import EventApplication | ||
from organize.models import Coorganizer, EventApplication | ||
|
||
|
||
def test_comment_required_for_on_hold_application(base_application): | ||
|
@@ -119,3 +119,10 @@ def test_previous_application_with_approximate_date(data_dict, previous_applicat | |
assert EventApplication.object.count() == 1 | ||
EventApplication.object.create(**data_dict) | ||
assert EventApplication.object.count() == 2 | ||
|
||
|
||
def test_coorganizer_str(base_application): | ||
org = Coorganizer.objects.create( | ||
event_application=base_application, email="[email protected]", first_name="Anna", last_name="Smith" | ||
) | ||
assert str(org) == f"{org.first_name} {org.last_name} <{org.email}>" |
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,11 @@ | ||
from patreonmanager.models import FundraisingStatus, Payment | ||
|
||
|
||
def test_payment_str(payment): | ||
payment = Payment.objects.get() | ||
assert str(payment) == f"{payment.patron}, {payment.month}" | ||
|
||
|
||
def test_fundraisingstatus_str(): | ||
status = FundraisingStatus.objects.create(number_of_patrons=1, amount_raised=1) | ||
assert str(status) == f"{status.id} updated {status.date_updated}, raised {status.amount_raised}" |
Empty file.
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,14 @@ | ||
import pytest | ||
|
||
from sponsor.models import Donor, Sponsor | ||
|
||
|
||
@pytest.fixture() | ||
def donor(): | ||
donor = Donor.objects.create(name="Ola", amount=50, visible=True) | ||
return donor | ||
|
||
|
||
@pytest.fixture() | ||
def sponsor(): | ||
return Sponsor.objects.create(name="Company name") |
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,6 @@ | ||
def test_donor(donor): | ||
assert str(donor) == donor.name | ||
|
||
|
||
def test_sponsor(sponsor): | ||
assert str(sponsor) == sponsor.name |