Working tests and provider stats table.

Fix for tests and import error.

Added tests and updated for code review comments.
This commit is contained in:
Nicholas Staples
2016-04-25 10:38:37 +01:00
parent ff61223d97
commit b56e324a4c
14 changed files with 365 additions and 90 deletions

View File

@@ -152,7 +152,7 @@ TEMPLATE_TYPE_LETTER = 'letter'
TEMPLATE_TYPES = [TEMPLATE_TYPE_SMS, TEMPLATE_TYPE_EMAIL, TEMPLATE_TYPE_LETTER]
class Template(db.Model):
class Template(db.Model, Versioned):
__tablename__ = 'templates'
id = db.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
@@ -174,6 +174,8 @@ class Template(db.Model):
service_id = db.Column(UUID(as_uuid=True), db.ForeignKey('services.id'), index=True, unique=False, nullable=False)
service = db.relationship('Service', backref=db.backref('templates', lazy='dynamic'))
subject = db.Column(db.Text, index=False, unique=True, nullable=True)
created_by_id = db.Column(UUID(as_uuid=True), db.ForeignKey('users.id'), index=True, nullable=False)
created_by = db.relationship('User')
MMG_PROVIDER = "mmg"