Added tests

Based on django tests for 1.4, 1.5 and 1.6