coleifer/peewee — Issue #12: tests
Author: madisvain
Created: 2011-10-19 11:34:54+00:00
State: open

I sometimes get the following Failure:

```python
======================================================================
FAIL: test_filter_both_directions (tests.FilterQueryTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/diggy/Documents/dev/peewee/tests.py", line 1638, in test_filter_both_directions
self.assertSQLEqual(f.sql(), ('SELECT t1.* FROM entry AS t1 INNER JOIN entrytag AS t2 ON t1.pk = t2.entry_id\nINNER JOIN blog AS t3 ON t1.blog_id = t3.id WHERE t2.tag = ? AND t3.title = ?', ['t1', 'b1']))
File "/Users/diggy/Documents/dev/peewee/tests.py", line 157, in assertSQLEqual
self.assertEqual(lhs[0].replace('?', interpolation), rhs[0].replace('?', interpolation))
AssertionError: 'SELECT t1.* FROM entry AS t1 INNER JOIN blog AS t2 ON t1.blog_id = t2.id\nINNER JOIN entrytag AS t3 ON t1.pk = t3.entry_id WHERE t2.title = ? AND t3.tag = ?' != 'SELECT t1.* FROM entry AS t1 INNER JOIN entrytag AS t2 ON t1.pk = t2.entry_id\nINNER JOIN blog AS t3 ON t1.blog_id = t3.id WHERE t2.tag = ? AND t3.title = ?'
----------------------------------------------------------------------
```

And always this one:

```python
======================================================================
FAIL: test_count (tests.QueryTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/diggy/Documents/dev/peewee/tests.py", line 495, in test_count
self.assertEqual(count, 200)
AssertionError: 240 != 200

----------------------------------------------------------------------
Ran 56 tests in 4.145s
```

I'm already working on these - but these seme really ODD actually. There is something interesting going on at this

```python
for blog in SelectQuery(Blog):
print blog
for i in xrange(20):
self.create_entry(title='entry%d' % i, blog=blog)
```

Which outputs: