Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Jer-Sch committed Sep 8, 2021
1 parent e746f4e commit 0fcf531
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/grants/tests/models/factories/grant_api_key_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ class GrantAPIKeyFactory(factory.django.DjangoModelFactory):
class Meta:
model = GrantAPIKey

profile = factory.SubFactory(ProfileFactory)
profile = factory.SubFactory(ProfileFactory)
2 changes: 1 addition & 1 deletion app/grants/tests/models/factories/profile_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ class Meta:
model = Profile

handle = factory.Sequence(lambda n: "Contributor_%03d" % n)
data = {}
data = {}
8 changes: 3 additions & 5 deletions app/grants/tests/models/test_grant_api_key.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest
from grants.models.grant_api_key import GrantAPIKey
from dashboard.models import Profile
from grants.models.grant_api_key import GrantAPIKey

from .factories.grant_api_key_factory import GrantAPIKeyFactory

Expand All @@ -22,15 +22,15 @@ def test_grant_api_key_has_a_key(self):
grant_api_key = GrantAPIKeyFactory()

assert hasattr(grant_api_key, 'key')
assert grant_api_key.key == None
assert grant_api_key.key == ''

def test_grant_api_key_has_a_secret(self):
"""Test secret attribute is present and is blank."""

grant_api_key = GrantAPIKeyFactory()

assert hasattr(grant_api_key, 'secret')
assert grant_api_key.secret == None
assert grant_api_key.secret == ''

def test_grant_api_key_belongs_to_a_profile(self):
"""Test profile attribute is present."""
Expand All @@ -39,5 +39,3 @@ def test_grant_api_key_belongs_to_a_profile(self):

assert hasattr(grant_api_key, 'profile')
assert isinstance(grant_api_key.profile, Profile)


0 comments on commit 0fcf531

Please sign in to comment.