Re: Keeping/accessing the data Django generates during a test run

2023-12-05 Thread Juan diego Jacobo hernandez
Yes thanks

(null)


El El mar, 5 de dic de 2023 a la(s) 13:41, dilo...@gmail.com <
dilou...@gmail.com> escribió:

> HelloI am running into the same problem but I do not understand what needs
> to be done. I use keepdb but how can I get the database cursor connection.
> Do I need to modify the test script?
> Thanks for your help.
>
> Le mercredi 13 février 2019 à 10:54:04 UTC+1, Anton Melser a écrit :
>
>> When you use django unittests commit is made as no-op. Use --keepdb and
>>> at the end of your tests run SQL commit against your database cursor
>>> connection.
>>>
>>
>> Awesome, exactly the info I was missing. Thanks for your help.
>> Cheers,
>> Anton
>>
>
>> --
> 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 django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/80b4d9ea-e502-4ac5-8032-81ec0a99f4ffn%40googlegroups.com
> 
> .
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAE4dRnL6WGQhmp6piJWwQs9EZJsGNK8YR5OCVx_fNCpnT3gC2A%40mail.gmail.com.


Re: Keeping/accessing the data Django generates during a test run

2023-12-05 Thread dilo...@gmail.com
HelloI am running into the same problem but I do not understand what needs 
to be done. I use keepdb but how can I get the database cursor connection. 
Do I need to modify the test script?
Thanks for your help.

Le mercredi 13 février 2019 à 10:54:04 UTC+1, Anton Melser a écrit :

> When you use django unittests commit is made as no-op. Use --keepdb and at 
>> the end of your tests run SQL commit against your database cursor 
>> connection.
>>
>  
> Awesome, exactly the info I was missing. Thanks for your help.
> Cheers,
> Anton
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/80b4d9ea-e502-4ac5-8032-81ec0a99f4ffn%40googlegroups.com.


Re: Keeping/accessing the data Django generates during a test run

2019-02-13 Thread Anton Melser
>
> When you use django unittests commit is made as no-op. Use --keepdb and at
> the end of your tests run SQL commit against your database cursor
> connection.
>

Awesome, exactly the info I was missing. Thanks for your help.
Cheers,
Anton

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKywjPpYWa3D9KvB%3DzYoas_UNKgHxk%3DY4vJqeAGnjLE65Kq0Gg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Keeping/accessing the data Django generates during a test run

2019-02-13 Thread Jani Tiainen
When you use django unittests commit is made as no-op. Use --keepdb and at
the end of your tests run SQL commit against your database cursor
connection.

On Wed, Feb 13, 2019 at 5:54 AM Anton Melser  wrote:

> Hi,
>
> I can't work out whether it is expected or whether I am missing something.
> I would like to keep the DB data that I generate during a test run to
> inspect/persist it. --keepdb means I have empty tables at the end,
> strangely even if I ctrl-C a test run. It would also be logical for test
> data to get cleaned... Is there an option I can add to keep it?
>
> I have a lot of calls to external services that should be mocked. The json
> returned from these calls is put in the DB as-is, so if I can just set up
> an initial run of the tests and then get the data from the DB that would be
> optimal. I could add file writes about the place to persist, but I want to
> evolve the test data over time and will need to do this often, so being
> able to do that from the DB would be very handy.
>
> Any pointers?
>
> Thanks,
> Anton
>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f9d2dfe3-c832-45bd-a6d3-7f3415f1293d%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Jani Tiainen

- Well planned is half done, and a half done has been sufficient before...

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHn91ofX4s7zouEtU-3OMuzQuRWFUw6v-uqHVEixjKPgy-p5ww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Keeping/accessing the data Django generates during a test run

2019-02-12 Thread Mike Dewhirst
Have you looked at fixtures?

manage.py dumpdata will create a json file from a database. I use it to 
populate the test database from production data reference tables. dumpdata 
let's you --exclude=... the other tables. 

I know that's not exactly what you asked for but maybe you can import data 
written to files into a database for conversion into fixtures?

Mike

Connected by Motorola

Anton Melser  wrote:

>Hi,
>
>
>I can't work out whether it is expected or whether I am missing something. I 
>would like to keep the DB data that I generate during a test run to 
>inspect/persist it. --keepdb means I have empty tables at the end, strangely 
>even if I ctrl-C a test run. It would also be logical for test data to get 
>cleaned... Is there an option I can add to keep it?
>
>
>I have a lot of calls to external services that should be mocked. The json 
>returned from these calls is put in the DB as-is, so if I can just set up an 
>initial run of the tests and then get the data from the DB that would be 
>optimal. I could add file writes about the place to persist, but I want to 
>evolve the test data over time and will need to do this often, so being able 
>to do that from the DB would be very handy.
>
>
>Any pointers?
>
>
>Thanks,
>
>Anton
>
>-- 
>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 django-users+unsubscr...@googlegroups.com.
>To post to this group, send email to django-users@googlegroups.com.
>Visit this group at https://groups.google.com/group/django-users.
>To view this discussion on the web visit 
>https://groups.google.com/d/msgid/django-users/f9d2dfe3-c832-45bd-a6d3-7f3415f1293d%40googlegroups.com.
>For more options, visit https://groups.google.com/d/optout.

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bbkgdkufdyjjmdrv1cjsyo4j.1550034368654%40email.android.com.
For more options, visit https://groups.google.com/d/optout.


Keeping/accessing the data Django generates during a test run

2019-02-12 Thread Anton Melser
Hi,

I can't work out whether it is expected or whether I am missing something. 
I would like to keep the DB data that I generate during a test run to 
inspect/persist it. --keepdb means I have empty tables at the end, 
strangely even if I ctrl-C a test run. It would also be logical for test 
data to get cleaned... Is there an option I can add to keep it?

I have a lot of calls to external services that should be mocked. The json 
returned from these calls is put in the DB as-is, so if I can just set up 
an initial run of the tests and then get the data from the DB that would be 
optimal. I could add file writes about the place to persist, but I want to 
evolve the test data over time and will need to do this often, so being 
able to do that from the DB would be very handy.

Any pointers?

Thanks,
Anton

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f9d2dfe3-c832-45bd-a6d3-7f3415f1293d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.