Thanks!, So for each test , do i need to add same test data? or do we have 
any other way not to repeat the same test data?

On Tuesday, 13 August 2019 20:32:16 UTC+5:30, Vinicius Assef wrote:
>
> The database is cleared after each test method.
>
> So, in a new testcase your database is empty.
>
> On Tue, 13 Aug 2019 at 00:34, Arulselvam K <[email protected] 
> <javascript:>> wrote:
>
>> Have hosted the code @ "https://github.com/tbone230590/plib"; 
>> Here is the problem I have two models Book and IssuedBook, IssuedBook 
>> have foreign key relation to Book object.Those models are defined @ 
>> "/api/data/models" I have unit tests for testing those models and are 
>> available @ "/api/unit_tests/models". 
>> I am able to test Book model successfully. But I have a test for 
>> IssuedBook model which is referring Book model is getting failed. 
>> It seems cause of the problem is referring Book object created in 
>> BookTestCase that was previously run. But I dont understand that why Book 
>> record getting deleted after first testcase execution.
>> Could you educate me on this to solve the problem?
>>
>> -- 
>> 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] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/cf28d61d-8582-4148-a14a-9349fdfcca8f%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/cf28d61d-8582-4148-a14a-9349fdfcca8f%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3bd0af6e-7e6d-4115-9c95-f92c4d9ca60d%40googlegroups.com.

Reply via email to