Exemplo n.º 1
0
def test_insert_row_dict_numeric(cursor):
    value = 101
    values = {
        'id': random_utilities.random_string(),
        'numeric_col': value
    }
    assert postgres.insert_row_as_dict(cursor, test_table_name, values) is True
    postgres.remove_row(cursor, test_table_name, 'numeric_col', value)
Exemplo n.º 2
0
def test_remove_row(cursor):
    column = 'id'
    columns = f'({column})'
    value = random_utilities.random_letters()
    values = f"('{value}')"
    postgres.insert_row(cursor, test_table_name, columns, values)
    assert postgres.remove_row(cursor, test_table_name, column, value) is True
Exemplo n.º 3
0
 def delete_row(self, column, value):
     return postgres.remove_row(self.cursor, self.name, column, value)
Exemplo n.º 4
0
def test_remove_row_invalid(cursor):
    assert postgres.remove_row(cursor, test_table_name, None, None) is False
Exemplo n.º 5
0
def test_insert_row_dict_apostrophe(cursor):
    value = "test'apo"
    values = {'id': value}
    assert postgres.insert_row_as_dict(cursor, test_table_name, values) is True
    postgres.remove_row(cursor, test_table_name, 'id', value)