TST: Travis/Coveralls setup (#10)

- add travis.yml
- linting
- coveralls
- readme
This commit is contained in:
Matthew Ryan Dillon 2016-08-28 16:30:20 -07:00
parent 8622e2323d
commit 983ce6f021
15 changed files with 107 additions and 50 deletions

View file

@ -53,10 +53,12 @@ class Processing(models.Model):
measurement_unit = models.ForeignKey('misc.MeasurementUnit', blank=True,
null=True, related_name='processings')
minutes_in_reagent = models.IntegerField(blank=True, null=True)
flaw = models.ForeignKey(Flaw, blank=True, null=True, related_name='processings')
flaw = models.ForeignKey(Flaw, blank=True, null=True,
related_name='processings')
def __str__(self):
return "{} {} {}".format(self.process_date, self.process_type, self.container_label)
return "{} {} {}".format(self.process_date, self.process_type,
self.container_label)
class Meta:
unique_together = ('process_type', 'container', 'container_label',

View file

@ -52,13 +52,15 @@ class ProcessingTestCase(TestCase):
def test_creation(self):
p = ProcessingFactory()
self.assertTrue(isinstance(p, Processing))
name = "{} {} {}".format(p.process_date, p.process_type, p.container_label)
name = "{} {} {}".format(p.process_date, p.process_type,
p.container_label)
self.assertEqual(p.__str__(), name)
def test_uniqueness(self):
p1 = ProcessingFactory()
with transaction.atomic(), self.assertRaises(IntegrityError):
ProcessingFactory(process_type=p1.process_type, container=p1.container,
ProcessingFactory(process_type=p1.process_type,
container=p1.container,
container_label=p1.container_label,
process_date=p1.process_date,
process_time=p1.process_time, reagent=p1.reagent)