Make sure can't import a single record twice (in one go).
: """Make sure can't import a single record twice (in one go).""" record = SeqRecord(Seq("ATGCTATGACTAT", Alphabet.generic_dna),id="Test1") try: count = self.db.load([record,record]) except Exception, err: #Good! #Note we don't do a specific exception handler because the #exception class will depend on which DB back end is in use. self.assertTrue(err.__class__.__name__ in ["IntegrityError", "OperationalError"], err.__class__.__name__) return raise Exception("Should have failed! Loaded %i records" % count)