Exemplo n.º 1
0
    def test_idx_billcode_exists(self):
        """Testing function idx_billcode_exists."""
        # Testing with known good value
        expected = True
        result = db_billcode.idx_billcode_exists(self.expected['idx_billcode'])
        self.assertEqual(result, expected)

        # Testing with known bad value
        expected = False
        result = db_billcode.idx_billcode_exists(None)
        self.assertEqual(result, expected)
Exemplo n.º 2
0
    def _insert_billcode(self):
        """Insert first billcode in the database.

        Args:
            None

        Returns:
            None

        """
        # Insert
        if db_billcode.idx_billcode_exists(1) is False:
            record = Billcode(code=general.encode(self.reserved),
                              name=general.encode(self.reserved))
            database = db.Database()
            database.add(record, 1104)