Exemple #1
0
    def test_save(self):
        RejectionPattern("Something").save()
        RejectionPattern(u"人员", None).save()

        print RejectionPattern.findall()

        conn = self.connect_db()
        try:
            c = conn.cursor()
            c.execute("SELECT COUNT(*) FROM " + RejectionPattern.table_name)
            self.assertEqual(c.fetchone()[0], 2, "Count of rejection_pattern should be 2")
        except:
            pass
        finally:
            conn.close()
Exemple #2
0
    def test_save(self):
        RejectionPattern('Something').save()
        RejectionPattern(u'人员', None).save()

        print RejectionPattern.findall()

        conn = self.connect_db()
        try:
            c = conn.cursor()
            c.execute('SELECT COUNT(*) FROM ' + RejectionPattern.table_name)
            self.assertEqual(c.fetchone()[0], 2, 'Count of rejection_pattern should be 2')
        except:
            pass
        finally:
            conn.close()
Exemple #3
0
    def test_find_all(self):
        self.rejection_pattern.save()
        another_rejection_pattern = RejectionPattern("[a-z]+", u"人员")
        another_rejection_pattern.save()

        records = RejectionPattern.findall()
        print "rejection_pattern", records
        self.assertEqual(2, len(records))
Exemple #4
0
    def test_find_all(self):
        self.rejection_pattern.save()
        another_rejection_pattern = RejectionPattern('[a-z]+', u'人员')
        another_rejection_pattern.save()

        records = RejectionPattern.findall()
        print 'rejection_pattern', records
        self.assertEqual(2, len(records))