﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
15081	When running tests you cannot use data that is inserted the <app>/sql/model.sql	maesjoch	nobody	"Consider following case:

#model
{{{
class sqltest(models.Model):
    
    name = models.CharField(max_length=100, unique=True)
}}}

#test
{{{
from django.test import TestCase
from testapp.app_test.models import sqltest

class SimpleTest(TestCase):
    def test_basic_addition(self):
        s = sqltest.objects.get(name='test1')
        self.assertTrue(s)
}}}

#in <app>/sql/sqltest.py
{{{
insert into app_test_sqltest (name) values ('test1');
insert into app_test_sqltest (name) values ('test2');
insert into app_test_sqltest (name) values ('test3');
}}}

When running your tests will not find the test1 entry. This is not consistent with how django docs explain it (although not that much testing information on custom sql).

Was this by design or is it an actual bug I do not know."		closed	Testing framework	1.2		worksforme	custom sql		Unreviewed	0	0	0	0	0	0
