Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
stub out Team takes Python
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed May 10, 2016
1 parent fd303f1 commit 8685429
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gratipay/models/team/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from aspen import json, log
from gratipay.exceptions import InvalidTeamName
from gratipay.models import add_event
from gratipay.models.team import mixins
from postgres.orm import Model

from gratipay.billing.exchanges import MINIMUM_CHARGE
Expand All @@ -30,7 +31,7 @@ def slugize(name):
return slug


class Team(Model):
class Team(Model, mixins.Takes):
"""Represent a Gratipay team.
"""

Expand Down
3 changes: 3 additions & 0 deletions gratipay/models/team/mixins/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .takes import TakesMixin as Takes

__all__ = ['Takes']
19 changes: 19 additions & 0 deletions gratipay/models/team/mixins/takes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from __future__ import absolute_import, division, print_function, unicode_literals


class TakesMixin(object):
"""This mixing provides management of takes for
:py:class:`~gratipay.models.team.Team` objects.
"""


def enable_takes(self):
"""Allow this Team to issue takes.
"""
pass


def disable_takes(self):
"""Prevent this Team from issuing takes.
"""
pass
11 changes: 11 additions & 0 deletions tests/py/test_team_takes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from __future__ import absolute_import, division, print_function, unicode_literals

from gratipay.testing import Harness
from gratipay.models.team import mixins


class Tests(Harness):

def test_team_object_subclasses_takes_mixin(self):
enterprise = self.make_team('The Enterprise')
assert isinstance(enterprise, mixins.Takes)

0 comments on commit 8685429

Please sign in to comment.