Re: django testing: widgets

2020-10-11 Thread Dvs Khamele
Hi do you hire contract based python/django freelancer? We can help you in this and related tasks at fair prices. Reply or send email to divy...@pythonmate.com Best Regards, Divyesh Khamele, Pythonmate On Thu, 1 Oct 2020, 6:32 pm albert, wrote: > Hi > due to the impact of corona/covid19 I am wo

django testing: widgets

2020-10-01 Thread albert
Hi due to the impact of corona/covid19 I am working in a django-web-project. (I am a beginner to those Technologies...) At the moment I am writing tests for a django application. Basic tests for creating get- and post-request with the test server (client) are working. But now I am facing a file

Re: Django Testing

2020-04-10 Thread Jatin Agrawal
The main reason behind learning about Testing is to check if the views that we have written for, are generating the expected results or not. Suppose you are writing an APIView to get a list of something, then you should write a testcase to check whether that APIView is giving you the result tha

Re: Django Testing

2020-03-31 Thread Lunga Baliwe
Good day, I hope this ( https://docs.djangoproject.com/en/3.0/intro/tutorial05/#writing-our-first-test) can help, its part of the Django tutorials. On Tue, Mar 31, 2020 at 4:35 PM ekong, emmanuel wrote: > I’m having the same difficulty... > > On Tue, 31 Mar 2020 at 3:32 PM, Abrar Ahmad > wrote

Re: Django Testing

2020-03-31 Thread ekong, emmanuel
I’m having the same difficulty... On Tue, 31 Mar 2020 at 3:32 PM, Abrar Ahmad wrote: > Hello Sir > I have trouble in learnig Testing tutorial of Djanog Documentation. > Can any one tell me what is the main concept of learnign test and how can > we learn it in easiest way. > I am waiting for repl

Django Testing

2020-03-31 Thread Abrar Ahmad
Hello Sir I have trouble in learnig Testing tutorial of Djanog Documentation. Can any one tell me what is the main concept of learnign test and how can we learn it in easiest way. I am waiting for reply -- You received this message because you are subscribed to the Google Groups "Django users"

How can i keep test data in django testing

2015-05-28 Thread Sub Zero
I am using django 1.8 and it says to use --keepdb to save test database https://docs.djangoproject.com/en/1.8/topics/testing/overview/#the-test-database I am doing that and database is there but everytime i see it and it is empty and has no data in it. Is there any way that i can preserve th

Re: Testing Django: testing template at different time

2015-03-18 Thread Zaki Akhmad
On Fri, Mar 13, 2015 at 5:32 AM, Collin Anderson wrote: > Hi, > > You could try using freezegun to run the test as if it were a certain time > of day. > https://pypi.python.org/pypi/freezegun Hi Collin, thanks for the response. After spent some time, finally I managed to get the testing. I put

Re: Testing Django: testing template at different time

2015-03-12 Thread Collin Anderson
Hi, You could try using freezegun to run the test as if it were a certain time of day. https://pypi.python.org/pypi/freezegun Or, you could say something like: if 9 <= datetime.datetime.now().hour < 17: self.assertContains(response, "It's working time!") else: self.assertContains(respon

Testing Django: testing template at different time

2015-03-11 Thread Zaki Akhmad
Hello, I'd like to write a test script for my django app. Example, if within business hour, my django app will render: "It's working time!" And if not within business hour, my django app will render: "Happy holiday!" So the views, will check when the url is accessed. How do I write the test sc

Django testing hooks

2014-09-03 Thread Andreas Kuhne
Hi all, When running django tests (django 1.6) is it possible to run a specific command before the tests and run a command on failure and on success? I have bought a blink1 (http://blink1.thingm.com/) and would like it to change colour depending on the results of the tests. Is this possible? Reg

Re: newcomer to django testing

2014-06-09 Thread Andromeda Yelton
You can also add a depends_on statement to your south migrations, if you really need them to run in a particular order: http://south.readthedocs.org/en/latest/dependencies.html On Sun, Jun 8, 2014 at 2:09 PM, monoBOT wrote: > Hi Esau. > > Funny to see you here ;.D > > I checked what you told me

Re: newcomer to django testing

2014-06-08 Thread monoBOT
Hi Esau. Funny to see you here ;.D I checked what you told me and its true ... if I try to create the database starting with the comunidad table it raises the error but when starting the migrations with usuario it goes smooth. Simply changing the app order in the settings.py file fixed the prob

Re: newcomer to django testing

2014-06-08 Thread Esau Rodriguez
The testing process creates db itself when using south it migrate all apps with migrations. Could you have a problem with your migrations when run from zero?. Regards Esau Rodriguez. On Sun, Jun 8, 2014 at 10:20 AM, monoBOT wrote: > Im new on testing ... to be honest its my first django test

newcomer to django testing

2014-06-08 Thread monoBOT
Im new on testing ... to be honest its my first django test XD Now i wanted to test one of my applications and after the innitial tweaking of allowing the django user to be able to create databases i get this error: ​The error was: relation "usuario_usuario" does not exist Error in migration: co

Re: Django testing strategy

2012-10-10 Thread Daniele Procida
On Thu, Oct 4, 2012, Daniele Procida wrote: >I have started writing my first tests, for a project that has become >pretty large (several thousand lines of source code). >I'd appreciate any advice. Many thanks for the advice and suggestions. This is what I have produced so far:

Re: Django testing strategy

2012-10-09 Thread Lachlan Musicman
This has been a very interesting thread - out of interest, does anyone have a preference for one of factory-boy or django-dynamic-fixture and why? They look similarly up to date and useful, but I've no idea how to differentiate them. cheers L. -- ...we look at the present day through a rear-vie

Re: Django testing strategy

2012-10-05 Thread Josh Crompton
There are a couple of problems with setting up a big database and then writing integration tests. Your tests will be slow, so they won't get run. They'll also be increasingly hard to maintain. Fixtures only seem make that worse. You've already got a code base that needs maintaining, you don't w

Re: Django testing strategy

2012-10-05 Thread Dan Gentry
I've been using factory-boy as of late, and have found it to be a great way to setup each test exactly as I need it. Fixtures aren't bad either, but working with a large amount of data can make it difficult to predict the proper output for a test, and changes to this data to accommodate a new

Re: Django testing strategy

2012-10-05 Thread Amirouche
On Friday, October 5, 2012 9:56:34 AM UTC+2, Daniele Procida wrote: > > On Thu, Oct 4, 2012, Evan Brumley > > wrote: > > >django-dynamic-fixture can also help a lot in this situation: > >http://paulocheque.github.com/django-dynamic-fixture/ > > > >Certainly beats having to futz around with f

Re: Django testing strategy

2012-10-05 Thread Amirouche
On Thursday, October 4, 2012 7:49:19 PM UTC+2, Daniele Procida wrote: > > I have started writing my first tests, for a project that has become > pretty large (several thousand lines of source code). > That is too, late! ;-) > > What needs the most testing - where most of the bugs or incorre

Re: Django testing strategy

2012-10-05 Thread Amirouche
Please ignore this message I've hit «Post» by mistake I will edit my post :) -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/0S78LxSWkXoJ. To post to this

Re: Django testing strategy

2012-10-05 Thread Amirouche
On Thursday, October 4, 2012 7:49:19 PM UTC+2, Daniele Procida wrote: > > I have started writing my first tests, for a project that has become > pretty large (several thousand lines of source code). > That is too, late! ;-) > > What needs the most testing - where most of the bugs or incorre

Re: Django testing strategy

2012-10-05 Thread Daniele Procida
On Thu, Oct 4, 2012, Evan Brumley wrote: >django-dynamic-fixture can also help a lot in this situation: >http://paulocheque.github.com/django-dynamic-fixture/ > >Certainly beats having to futz around with fixtures. Thanks - there seem to be a lot of tools to generate test data in various ways,

Re: Django testing strategy

2012-10-04 Thread Evan Brumley
django-dynamic-fixture can also help a lot in this situation: http://paulocheque.github.com/django-dynamic-fixture/ Certainly beats having to futz around with fixtures. On Friday, October 5, 2012 3:49:19 AM UTC+10, Daniele Procida wrote: > > I have started writing my first tests, for a project t

Re: Django testing strategy

2012-10-04 Thread Thomas Orozco
You can use `fixtures` for this purpose! You can have several of them to have exactly the data you need for a test. Have a look there: https://docs.djangoproject.com/en/dev/topics/testing/#django.test.TestCase.fixtures Cheers, Thomas 2012/10/4 Daniele Procida > I have started writing my firs

Django testing strategy

2012-10-04 Thread Daniele Procida
I have started writing my first tests, for a project that has become pretty large (several thousand lines of source code). What needs the most testing - where most of the bugs or incorrect appear emerge - are the very complex interactions between objects in the system. To me, the intuitive way

Re: Django testing and unique=True

2011-12-13 Thread Karen Tracey
On Tue, Dec 13, 2011 at 8:33 AM, Acruax wrote: > Hi, > I have a problem with model testing. My test fails with error: > IntegrityError: duplicate key value violates unique constraint > "catalog_name_key" > DETAIL: Key (name)=(test_catalog1) already exists. > > I have unique=True on name

Django testing and unique=True

2011-12-13 Thread Acruax
Hi, I have a problem with model testing. My test fails with error: IntegrityError: duplicate key value violates unique constraint "catalog_name_key" DETAIL: Key (name)=(test_catalog1) already exists. I have unique=True on name field. class CatalogTestCase(unittest.TestCase): def s

Re: django testing. random test order with some 'dependency constraints'

2011-11-28 Thread Gelonida N
Hi Russel, Thanks for your answer. On 11/28/2011 04:12 AM, Russell Keith-Magee wrote: > On Mon, Nov 28, 2011 at 9:39 AM, Gelonida N wrote: > . . . > Unit tests are supposed to be isolated. They shouldn't depend on > execution order, or have any pre-requisite other than those specified > as part

Re: django testing. random test order with some 'dependency constraints'

2011-11-27 Thread Russell Keith-Magee
On Mon, Nov 28, 2011 at 9:39 AM, Gelonida N wrote: > I'd like to create some unit tests whch should be executed in random order. > > > However some tests could benefit from results of some predecessor tests. > > Therefore they should be executed only after certain tests. Unit tests are supposed t

django testing. random test order with some 'dependency constraints'

2011-11-27 Thread Gelonida N
I'd like to create some unit tests whch should be executed in random order. However some tests could benefit from results of some predecessor tests. Therefore they should be executed only after certain tests. Did anybody try to implement such a test setup with Django's default unit tests? Are

Re: django testing with postgres without permissions to create databases

2011-11-26 Thread Gelonida N
On 11/26/2011 01:23 AM, Gelonida N wrote: > It seems I'm not the first one who wans to run django tests with > postgressql and who doesn't have permissions to create databases. > > I found two suggestions on the web: > > One is to use sqlite for testing instead of postgres. > However I'm not real

django testing with postgres without permissions to create databases

2011-11-25 Thread Gelonida N
It seems I'm not the first one who wans to run django tests with postgressql and who doesn't have permissions to create databases. I found two suggestions on the web: One is to use sqlite for testing instead of postgres. However I'm not really happy with this solution, as sqlite is less sensiti

Re: django testing: adapt some vars in settings.py if testing

2011-11-23 Thread Gelonida N
Hi Mike, Yes this idea is simple enough. I just wondered whether there isn't a tiny risk of finding 'test' as a paramter of one of the option in some esotheric cases. For what I am doing the solution should be absolutely fine. With my habit of using ./manage.py I could even change it to if sys.

Re: django testing: adapt some vars in settings.py if testing

2011-11-23 Thread Mike Dewhirst
There was a great solution to this posted just yesterday ... import sys if 'runserver' in sys.argv: DEBUG = True else: DEBUG = False ... which suggests if 'test' in sys.argv: do this On 24/11/2011 9:53am, Gelonida N wrote: Hi, I just started reading about

django testing: adapt some vars in settings.py if testing

2011-11-23 Thread Gelonida N
Hi, I just started reading about django testing. Now I have a small question. Whe running tests I would like to change a few variables in settings.py, but keep all the rest identical. Example: - I might like ot change the media directory - I might like to use another db engine How can I

Re: Django testing with existing data

2011-08-29 Thread Carlos Brum
wrote: > > Hello guys, > > > I'm new in Django testing whith django test facilities. > > > I've read "https://docs.djangoproject.com/en/1.3/topics/testing/"; but > > couldn't find what i'm looking for. > > > I'm trying t

Re: Django testing with existing data

2011-08-23 Thread Russell Keith-Magee
On Tue, Aug 23, 2011 at 9:15 PM, Carlos Brum wrote: > Hello guys, > > I'm new in Django testing whith django test facilities. > > I've read "https://docs.djangoproject.com/en/1.3/topics/testing/"; but > couldn't find what i'm looking for. > >

Django testing with existing data

2011-08-23 Thread Carlos Brum
Hello guys, I'm new in Django testing whith django test facilities. I've read "https://docs.djangoproject.com/en/1.3/topics/testing/"; but couldn't find what i'm looking for. I'm trying to begin TDD development but wanna use my old data. I don't wanna h

Re: Django testing not loading certain fixtures

2010-12-23 Thread churris
Are you loading you fixtures within your test class? eg. fixtures = ['my_fixture.xml'] Make sure that also you have included in yoour settings file the following: FIXTURE_DIRS = ( os.path.join(PROJECT_PATH, '../testing/fixtures') of course with the path where you fixture is. Hope this helps O

Re: Django testing not loading certain fixtures

2010-12-23 Thread caroline
never mind...error on my side On Dec 23, 1:52 pm, caroline wrote: > I'm experiencing some problems when loading fixtures for Django > unittests. > > If I create a fixture with manage.py dumpdata, then loading of the > fixture works (except for the fact that there is an sql error, as i am > using

Django testing not loading certain fixtures

2010-12-23 Thread caroline
I'm experiencing some problems when loading fixtures for Django unittests. If I create a fixture with manage.py dumpdata, then loading of the fixture works (except for the fact that there is an sql error, as i am using mysql innodb and django dumps some records before others with foreign key refer

Re: Django testing applications: using fixtures

2009-09-07 Thread Oleg Oltar
uot;build/bdist.macosx-10.3-i386/egg/MySQLdb/cursors.py", line 166, in execute self.errorhandler(self, exc, value) File "build/bdist.macosx-10.3-i386/egg/MySQLdb/connections.py", line 35, in defaulterrorhandler raise errorclass, errorvalue IntegrityError: (1062, "Duplicate

Re: Django testing applications: using fixtures

2009-09-07 Thread V
21 pm, Oleg Oltar wrote: > Django testing application: using fixtures > > Hi ! > > I came across strange problem while trying to use mixtures in my unittests > For example, I created a fixture from the database: > > silver:jin oleg$ python manage.py dumpdata  > datastore

Django testing applications: using fixtures

2009-09-06 Thread Oleg Oltar
Django testing application: using fixtures Hi ! I came across strange problem while trying to use mixtures in my unittests For example, I created a fixture from the database: silver:jin oleg$ python manage.py dumpdata > datastored.json Strange, but when the fixture is loaded while the t

Re: Django Testing

2009-08-20 Thread Gerard
If you got the tests in your project in a .../tests dir then add a testhelper.py with functions like this: def get_customer_data(self): customer_data = { 'company_name': 'TEST Company', 'company_zipcode': ' XX', 'company_address': 'Test Street 99', 'c

Django Testing

2009-08-20 Thread Vitaly Babiy
I been working on a django project for some time and I keep running in to the problem that fixtures are just to fragile, I was wondering if anyone had a suggestion on how they work around this. Does anyone know of a factory framework for django that I could define a collection of models and have th

Re: learning django testing

2007-07-26 Thread james_027
Thanks bob cheers, james On Jul 25, 11:48 pm, "Bob T." <[EMAIL PROTECTED]> wrote: > > I don't have any idea what is the > > testing all about. > > James, you might want to take a look at Dive Into Python [1] as a > starting place. It has a couple good chapters on testing and test > driven develo

Re: learning django testing

2007-07-25 Thread Bob T.
> I don't have any idea what is the > testing all about. James, you might want to take a look at Dive Into Python [1] as a starting place. It has a couple good chapters on testing and test driven development. Bob [1] http://diveintopython.org/unit_testing/index.html --~--~-~--~~--

learning django testing

2007-07-24 Thread james_027
hi, Here's another newbie stupid question ... I've heard testing everywhere from software development world, and the testing I know is to run the application I am developing and do all the possibilities that I user might do to make sure that the application behaves how it should be. I am studyin