Commit 9d16d57d authored by Taddeüs Kroes's avatar Taddeüs Kroes

Updated unit tests with latest database content.

parent ffb51c84
......@@ -8,7 +8,7 @@ class GenerateTest(TestCase):
conn = mysql.connect('localhost', 'root', 'mysql12#$', 'test')
def setUp(self):
self.model = Model('payments')
self.model = Model('payments', {})
def test_php_value_dict(self):
self.assertEqual(php_value({}), 'array()')
......@@ -51,12 +51,13 @@ class GenerateTest(TestCase):
self.assertEqual(flatten([['a'], ['b'], ('c', 'd')]), list('abcd'))
def test_read_tables(self):
self.assertEqual(read_tables(self.conn), ['payments', 'users'])
self.assertEqual(read_tables(self.conn),
['orders', 'payments', 'receipts', 'users'])
def test_read_fields(self):
fields = read_fields(self.conn, 'payments')
self.assertEqual([field['Field'] for field in fields],
['id', 'amount', 'user_id'])
['id', 'amount', 'user_id', 'order_id'])
def test_model_read_attributes(self):
self.model.read_attributes(self.conn)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment