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

Commit

Permalink
Start hacking on send_confirmation_email
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Feb 9, 2017
1 parent 455f06c commit 519d064
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
10 changes: 2 additions & 8 deletions gratipay/models/package/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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. :-)
"""

Expand Down Expand Up @@ -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
10 changes: 10 additions & 0 deletions gratipay/models/package/confirmation.py
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions gratipay/models/package/mixins.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals

from confirmation import Confirmation

__all__ = ['Confirmation']
6 changes: 6 additions & 0 deletions tests/py/test_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 519d064

Please sign in to comment.