Ejemplo n.º 1
0
 def produce(self):
     if self.scheme == 'sqlite':
         return SQLite(self.model)
     elif self.scheme == 'mysql':
         return MySQL(self.model)
     elif self.scheme == 'postgres':
         return PostgreSQL(self.model)
     else:
         return CommonSQL(self.model)
Ejemplo n.º 2
0
    def test_mysql_raises_missing_primary_key_exception(self):

        dummy = NotPrimaryModel()

        mysql = MySQL(dummy)
        self.assertRaises(MySQLMissingPrimaryKey, mysql.detect_primary_key)