diff --git a/gratipay/models/package/__init__.py b/gratipay/models/package/__init__.py index 571e2cb971..5cff94468e 100644 --- a/gratipay/models/package/__init__.py +++ b/gratipay/models/package/__init__.py @@ -2,13 +2,14 @@ from __future__ import absolute_import, division, print_function, unicode_literals from postgres.orm import Model +from gratipay.models.package import mixins NPM = 'npm' # We are starting with a single package manager. If we see # traction we will expand. -class Package(Model): +class Package(Model, mixins.Confirmation): """Represent a gratipackage. :-) """ @@ -40,10 +41,3 @@ def from_names(cls, package_manager, name): """ return cls.db.one("SELECT packages.*::packages FROM packages " "WHERE package_manager=%s and name=%s", (package_manager, name)) - - - # Emails - # ====== - - def send_confirmation_email(self, address): - pass diff --git a/gratipay/models/package/confirmation.py b/gratipay/models/package/confirmation.py new file mode 100644 index 0000000000..cd144995cf --- /dev/null +++ b/gratipay/models/package/confirmation.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +from __future__ import absolute_import, division, print_function, unicode_literals + + +class Confirmation(object): + + def send_confirmation_email(self, address): + """ + """ + pass diff --git a/gratipay/models/package/mixins.py b/gratipay/models/package/mixins.py new file mode 100644 index 0000000000..eb63d8dd47 --- /dev/null +++ b/gratipay/models/package/mixins.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +from __future__ import absolute_import, division, print_function, unicode_literals + +from confirmation import Confirmation + +__all__ = ['Confirmation'] diff --git a/tests/py/test_packages.py b/tests/py/test_packages.py index b97e888377..8831149322 100644 --- a/tests/py/test_packages.py +++ b/tests/py/test_packages.py @@ -14,3 +14,9 @@ def test_can_be_instantiated_from_id(self): def test_can_be_instantiated_from_names(self): self.make_package() assert Package.from_names(NPM, 'foo').name == 'foo' + + +class TestSendConfirmationEmail(Harness): + + def test_sends_confirmation_email(self): + pass