Django 1.10 with Postgres 9.? was throwing an error because the
samples_htsuser id that was assigned to an affiliation didn't exist in
the database.
The simplest solution I found was to delete the objects from the ORM,
I don't think they were ever actually created in the db so I'm not sure
how the constraint check was happening.
def tearDown(self):
shutil.rmtree(self.tempdir)
def tearDown(self):
shutil.rmtree(self.tempdir)
+ self.user_odd.delete()
+ self.user_even.delete()
+ self.admin.delete()
def test_flowcell_information(self):
"""
def test_flowcell_information(self):
"""
self.admin = HTSUserFactory.create(username='admintest', is_staff=True)
self.admin.set_password(self.password)
self.admin.save()
self.admin = HTSUserFactory.create(username='admintest', is_staff=True)
self.admin.set_password(self.password)
self.admin.save()
- self.super = HTSUserFactory.create(username='supertest', is_staff=True, is_superuser=True)
- self.super.set_password(self.password)
- self.super.save()
+ self.superuser = HTSUserFactory.create(username='supertest', is_staff=True, is_superuser=True)
+ self.superuser.set_password(self.password)
+ self.superuser.save()
self.library = LibraryFactory.create()
self.affiliation = AffiliationFactory()
self.library = LibraryFactory.create()
self.affiliation = AffiliationFactory()
self.url = '/experiments/started/{}/'.format(self.fc.id)
self.url = '/experiments/started/{}/'.format(self.fc.id)
+ def tearDown(self):
+ # with django 1.10 running against postgresql I had to delete these
+ # test objects or else I get a constraint error
+ self.affiliation.delete()
+ self.user.delete()
+ self.admin.delete()
+ self.superuser.delete()
+
def test_started_email_not_logged_in(self):
response = self.client.get(self.url)
self.assertEqual(response.status_code, 302)
def test_started_email_not_logged_in(self):
response = self.client.get(self.url)
self.assertEqual(response.status_code, 302)