Added pytest and broke up the consumer into file and mail

This commit is contained in:
Daniel Quinn
2016-02-05 00:23:36 +00:00
parent 3bc89d23c8
commit d8ad6b589b
12 changed files with 381 additions and 44 deletions

View File

@@ -157,5 +157,9 @@ class Document(models.Model):
@property
def parseable_file_name(self):
if self.sender and self.title:
return "{} - {}.{}".format(self.sender, self.title, self.file_types)
tags = ",".join([t.slug for t in self.tags.all()])
if tags:
return "{} - {} - {}.{}".format(
self.sender, self.title, tags, self.file_type)
return "{} - {}.{}".format(self.sender, self.title, self.file_type)
return os.path.basename(self.source_path)