-
-
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
Jer-Sch
committed
Sep 22, 2021
1 parent
b1961bb
commit 5158dda
Showing
5 changed files
with
59 additions
and
20 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import factory | ||
from grants.models.contribution import Contribution | ||
|
||
from .subscription_factory import SubscriptionFactory | ||
|
||
|
||
class ContributionFactory(factory.django.DjangoModelFactory): | ||
"""Create mock Contribution for testing.""" | ||
|
||
class Meta: | ||
model = Contribution | ||
|
||
subscription = factory.SubFactory(SubscriptionFactory) |
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,12 @@ | ||
import factory | ||
from dashboard.models import Profile | ||
|
||
|
||
class ProfileFactory(factory.django.DjangoModelFactory): | ||
"""Create mock Profile for testing.""" | ||
|
||
class Meta: | ||
model = Profile | ||
|
||
handle = factory.Sequence(lambda n: "Contributor_%03d" % n) | ||
data = {} |
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,15 @@ | ||
import factory | ||
from grants.models.subscription import Subscription | ||
|
||
from .grant_factory import GrantFactory | ||
from .profile_factory import ProfileFactory | ||
|
||
|
||
class SubscriptionFactory(factory.django.DjangoModelFactory): | ||
"""Create mock Subscription for testing.""" | ||
|
||
class Meta: | ||
model = Subscription | ||
|
||
grant = factory.SubFactory(GrantFactory) | ||
contributor_profile = factory.SubFactory(ProfileFactory) |
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