Hello.
I've just finished small django site, and keep going on creating tests.
I've found and issue with Model.objects.values_list  method.
Looks like it disregard test database and looks into production one.

Some details.
I have a form with a filed customer = 
forms.ChoiseField(choises=Customer.objects.values_list('id', 'name'))

When this form initing during tests, it loads data from production database.

My test looks like this.
class CustomerFormTest(TestCase):
    def setUp:
         self.customer = Customer.objects.create(name='test name')

    def test_form_creation(self):
        form = CustomerLoginForm()
        self.assertIn('test name', form.as_ul())


Assertion fails, and when I printing form content, I see select widget with 
options from production database objects.

Can somebody confirm it's a bug ?
Thank you.




-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1cae35ab-e9c1-4870-8e7e-18c2b9e1c22a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to