Django ModelForms - testing forms with model that have M2M inline instance using an intermediate model

2013-12-25 Thread luke lukes
I have invoice/estimates django app, I need to write tests for it. Since I'm a beginner with this, testing forms results hard for me. This is the code - for models, form and admin: # MODELS class Invoice(models.Model): subject = models.ForeignKey( Subject, verbose_name

Re: wxMailServer: GUI tool to help you with testing Django e-mails

2013-12-19 Thread Donald Casson
t;>> it, I get notices from Google about being on an IP that is not >>> allowed to send e-mails. So, anyway, it looks harder and harder. Why >>> do that, then? E-mail server running on localhost, displaying >>> incoming e-mails should be the best tool to test if your app

Re: wxMailServer: GUI tool to help you with testing Django e-mails

2013-12-19 Thread Donald Casson
us, and if I disable >> it, I get notices from Google about being on an IP that is not >> allowed to send e-mails. So, anyway, it looks harder and harder. Why >> do that, then? E-mail server running on localhost, displaying >> incoming e-mails should be the best tool to test if you

Re: wxMailServer: GUI tool to help you with testing Django e-mails

2013-12-19 Thread Arnold Krille
So, anyway, it looks harder and harder. Why > do that, then? E-mail server running on localhost, displaying > incoming e-mails should be the best tool to test if your app > generates proper e-mails. "Sending emails" for testing? There is this email-backend in django that

wxMailServer: GUI tool to help you with testing Django e-mails

2013-12-19 Thread Michał Pasternak
Hi, I would like to announce a GUI app, written in wxPython, that I quickly assembled yesterday mainly using some code from StackOverflow and Google. The app is called wxMailServer and all it does is: it acts as a mail server (it listens for traffic incoming at localhost port 25) and when an

Re: Testing Frameworks and Practices(consensus?)

2013-12-12 Thread Arnold Krille
Am Wed, 11 Dec 2013 12:03:44 -0500 schrieb Thomas Murphy <thomasmurphyco...@gmail.com>: > This seems like a more appropriate forum that SO for this discussion. > > I've been testing my apps with Selenium, which seems to be a popular > choice for Django, but so does unitte

Testing Frameworks and Practices(consensus?)

2013-12-11 Thread Thomas Murphy
Hi, This seems like a more appropriate forum that SO for this discussion. I've been testing my apps with Selenium, which seems to be a popular choice for Django, but so does unittest and some others, as well as using coverage to check for code coverage. I'm curious to hear about others

Re: Experiences with A/B testing?

2013-12-03 Thread Frank Bieniek
A/B Testing is an universe of its own... There is a saas called kiss metrics. Google offers a/b testing inside analytics. If you want to improve your conversion funnel, you need to factor in the source of your traffic and segment it. Taguchi Split Testing is another route. If you just want

Re: Experiences with A/B testing?

2013-12-03 Thread Anu G
I have also been looking into A/B testing. Did you use any of the above you mentioned...? If so which one you would recommend? Thanks On Friday, March 1, 2013 9:07:05 AM UTC-6, Tomás Solar Castro wrote: > > Hi everyone > > I want to make some A/B testing. I've searched f

Re: Fabric for dependency management, testing strategy

2013-11-11 Thread John DeRosa
s for fabric (and pip) > also you should google for best practices > > > On Mon, Nov 11, 2013 at 4:40 PM, Kannan <kanna...@gmail.com> wrote: > Hi Guys, > I am new to Fabric. Please send me your thoughts of using Fabric for > dependency management and also about the

Re: Fabric for dependency management, testing strategy

2013-11-11 Thread Avraham Serour
using Fabric for > dependency management and also about the testing strategy. > > > Additionally, Please send me tutorials or links or something that can > start with. > > > > > With regards, > Kannan > > -- > You received this message because you are

Fabric for dependency management, testing strategy

2013-11-11 Thread Kannan
Hi Guys, I am new to Fabric. Please send me your thoughts of using Fabric for dependency management and also about the testing strategy. Additionally, Please send me tutorials or links or something that can start with. With regards, Kannan -- You received this message because you

Re: Copy all the data from an existing database when create the testing database.

2013-10-07 Thread Tianyi Wang
seems more >> convenient. >> >> Tianyi >> >> On Friday, 4 October 2013 17:08:02 UTC+1, C. Kirby wrote: >>> >>> Do you always want all of the data from the existing database, or is this >>> just a quick way to have "real data" for

Re: Copy all the data from an existing database when create the testing database.

2013-10-05 Thread Kelvin Wong
t; Do you always want all of the data from the existing database, or is this >> just a quick way to have "real data" for testing. >> If it is the latter I would use manage.py dumpdata to generate test >> fixtures. You can load the fixtures in you tests as needed. >> &

Testing Django Class-based views

2013-10-05 Thread hjwp
I started a discussion about testing class-based (generic) views, a couple of people have pitched in already, thought I'd throw this out there in case anyone else can help: http://www.obeythetestinggoat.com/testing-django-class-based-generic-views-None.html It covers a couple of simple

Re: Copy all the data from an existing database when create the testing database.

2013-10-04 Thread Tianyi Wang
October 2013 17:08:02 UTC+1, C. Kirby wrote: > > Do you always want all of the data from the existing database, or is this > just a quick way to have "real data" for testing. > If it is the latter I would use manage.py dumpdata to generate test > fixtures. You can load

Re: Copy all the data from an existing database when create the testing database.

2013-10-04 Thread C. Kirby
Do you always want all of the data from the existing database, or is this just a quick way to have "real data" for testing. If it is the latter I would use manage.py dumpdata to generate test fixtures. You can load the fixtures in you tests as needed. Chaim On Friday, October 4, 20

Copy all the data from an existing database when create the testing database.

2013-10-04 Thread Tianyi Wang
Hi, When I run my tests, I'd like it to copy an existing database with all the data when create the testing database. I never thought about this till one of my colleague uses POSTGIS_TEMPLATE = DATABASES['default']['NAME'] for his tests. Because we use GeoDjango for our project, so

new project: django-mini-lean. no more excuses for not split testing!

2013-10-02 Thread Dan Ancona
Hiya django-users - Long time lurker, and long time user of many open source projects that I've never felt like I contributed enough back to. Finally changing that a bit today with the release of this an open source split testing framework, Django Mini Lean: https://github.com/DanAncona

Re: Testing: @override_settings(AUTH_USER_MODEL='auth.User') no working.

2013-09-30 Thread Serge G. Spaolonzi
override AUTH_USER_MODEL in the unittest? >> My goal is to use the default user model provided by django for the test >> only. > > > Yes, it is possible. That's why the approach is documented: > > https://docs.djangoproject.com/en/dev/topics/auth/customizing/#custom-users-

Re: Testing: @override_settings(AUTH_USER_MODEL='auth.User') no working.

2013-09-29 Thread Russell Keith-Magee
override AUTH_USER_MODEL in the unittest? > My goal is to use the default user model provided by django for the test > only. > Yes, it is possible. That's why the approach is documented: https://docs.djangoproject.com/en/dev/topics/auth/customizing/#custom-users-and-testing-fixtures If

Testing: @override_settings(AUTH_USER_MODEL='auth.User') no working.

2013-09-29 Thread Serge G. Spaolonzi
Hi, I am failing to override the AUTH_USER_MODEL settings for a unittest, it throws: "Manager isn't available; User has been swapped for 'None'" Is it possible to override AUTH_USER_MODEL in the unittest? My goal is to use the default user model provided by django for the test only. Thanks --

Re: Testing in Django - newbie questions on first test failure and coverage

2013-09-23 Thread Derek
Hi Yes, you are right: deleting the _fixture_setup method allows the tests to run successfully! I also do have all my fixture data stored in 'appname/fixtures/initial_data.json' so I assume from what you say that this data will only be loaded once for all the tests. Once I have more

Re: Testing in Django - newbie questions on first test failure and coverage

2013-09-23 Thread Derek
s I > have found that recommend these be placed in a different directory: > > From http://toastdriven.com/blog/2011/apr/17/guide-to-testing-in-django-2/ > > "I prefer to split up the tests into a file structure that mirrors the > app's setup. To do this, we create a new

Re: Testing in Django - newbie questions on first test failure and coverage

2013-09-22 Thread Rafael Durán Castañeda
ssue of test file locations - there are least two places I have > found that recommend these be placed in a different directory: > > From http://toastdriven.com/blog/2011/apr/17/guide-to-testing-in-django-2/ > > "I prefer to split up the tests into a file structure that mirrors the ap

Re: Testing in Django - newbie questions on first test failure and coverage

2013-09-21 Thread Derek
: >From http://toastdriven.com/blog/2011/apr/17/guide-to-testing-in-django-2/ "I prefer to split up the tests into a file structure that mirrors the app's setup. To do this, we create a new tests directory then move the existing tests.py into tests/views.py." From https

Re: Testing in Django - newbie questions on first test failure and coverage

2013-09-16 Thread Rafael Durán Castañeda
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. &g

Testing in Django - newbie questions on first test failure and coverage

2013-09-15 Thread Derek
I have an existing Django (1.4) project, with multiple apps and extensive business logic, that I need to write tests for. Based on a day or two of reading of the core Django docs and numerous blogs (each of which go about things subtly differently!?), I have made a start. As part of the seeming

Re: Testing Permissions in URL Includes

2013-09-13 Thread Lee Hinde
On Sep 13, 2013, at 12:47 PM, Arnold Krille wrote: > On Fri, 13 Sep 2013 11:30:44 -0700 Lee Hinde wrote: >> So, the question, is there a way to wrap url include calls in a >> permission check? > > Wrapping a whole url-include would only work when the

Re: Testing Permissions in URL Includes

2013-09-13 Thread Arnold Krille
On Fri, 13 Sep 2013 11:30:44 -0700 Lee Hinde wrote: > So, the question, is there a way to wrap url include calls in a > permission check? Wrapping a whole url-include would only work when the url-tree is rebuild for each request taking into account the requesting user. Todays

Testing Permissions in URL Includes

2013-09-13 Thread Lee Hinde
Using Django 1.5.x I have in my project urls.py entries like this: url(r'^staff/people/', include('people.urls')), url(r'^staff/admin/facility', include('facility.urls')), url(r'^staff/admin', include('district.urls')), url(r'^staff/section', include('classes.urls')),

Testing with legacy data

2013-08-08 Thread Dan Gentry
I'm not a fan of testing with actual data, except maybe as a final run to make sure no existing data breaks something or for stress testing with large amounts of data. Your legacy DB will not cover all of the possible cases that need to be tested in your code. Instead, write quality unit

Re: Testing with legacy data

2013-08-06 Thread Tom Evans
On Tue, Aug 6, 2013 at 5:59 AM, Jani Tiainen wrote: > Hi, > > I've legacy database that is rather large (around 300MB) containing lot more > than just data (triggers, stored procedures and such). > > Now how I can test with such a data? Preferably I would like to load data to

Testing with legacy data

2013-08-05 Thread Jani Tiainen
Hi, I've legacy database that is rather large (around 300MB) containing lot more than just data (triggers, stored procedures and such). Now how I can test with such a data? Preferably I would like to load data to database, run test, rollback changes and run a next test. But I really wouldn't

Re: Testing django views: RequestFactory and CSRF protection

2013-07-20 Thread Vladimir Ignatev
Well, looks like I've found workaround. At first we should test if a view have CSRF protection: def test_csrf_protected(self): request = RequestFactory().post('', data={}) response = views.register_form(request) self.assertEqual(response.status_code, 403) (fix me, it is

Testing django views: RequestFactory and CSRF protection

2013-07-18 Thread Vladimir Ignatev
I need using RequestFactory instead of Client to test one of my views. So the question is how to generate proper CSRF token to provide it to my @csrf_protect'ed view? At this moment I get 403 error when generating POST request. I've read similar topic in this group dated 2011 year, but that

Re: more testing questions

2013-07-09 Thread Dan Gentry
1) I've been using Factory Boy to create test data rather than fixtures. It is so much easier to ensure that I know exactly what data is available for a given test. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

Re: unit testing

2013-07-09 Thread ben
Also note that Django 1.6 will bring a better test discovery mechanism. See the full details at https://docs.djangoproject.com/en/dev/releases/1.6/#discovery-of-tests-in-any-test-module Django 1.6 ships with a new test runner that allows more flexibility in the > location of tests. The

Re: more testing questions

2013-07-08 Thread Javier Guerra Giraldez
On Mon, Jul 8, 2013 at 5:41 PM, Larry Martell wrote: > So if you don't use dump files, what do you do? Load data row by row > from within your test's setups? no, i mostly write the fixture data by hand. except when i need a series of records to cover a all (most?)

Re: more testing questions

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 4:21 PM, Javier Guerra Giraldez wrote: > On Mon, Jul 8, 2013 at 4:14 PM, Larry Martell wrote: >> It appesars it's trying to add a row to django_content_type and it's >> already there. I tried not loading the fixture for

Re: more testing questions

2013-07-08 Thread Javier Guerra Giraldez
On Mon, Jul 8, 2013 at 4:14 PM, Larry Martell wrote: > It appesars it's trying to add a row to django_content_type and it's > already there. I tried not loading the fixture for django_content_type > but I got the same error. These fixture files contain data I dumped >

Re: more testing questions

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 12:06 PM, Larry Martell wrote: > Still working on getting my tests to run. I have 2 issues right now: > > 1) I want to load data from fixture files. In this case I am trying to > load auth data to test the logins. I have this in my test code: > >

more testing questions

2013-07-08 Thread Larry Martell
Still working on getting my tests to run. I have 2 issues right now: 1) I want to load data from fixture files. In this case I am trying to load auth data to test the logins. I have this in my test code: from django.test import TestCase from django.contrib.auth.models import User, Permission

Re: unit testing

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 9:36 AM, Javier Guerra Giraldez wrote: > On Mon, Jul 8, 2013 at 10:13 AM, Larry Martell > wrote: >> I had seen the __init__ but I thought the tests had to be in the same >> dir as the models file. > > > the tests _module_ has

Re: unit testing

2013-07-08 Thread Javier Guerra Giraldez
On Mon, Jul 8, 2013 at 10:13 AM, Larry Martell wrote: > I had seen the __init__ but I thought the tests had to be in the same > dir as the models file. the tests _module_ has to be in the same dir as the models module. that means either a tests.py file, or a tests

Re: unit testing

2013-07-08 Thread Larry Martell
On Mon, Jul 8, 2013 at 8:59 AM, wrote: > > > On Monday, July 8, 2013 7:49:53 AM UTC-4, larry@gmail.com wrote: >> >> >> >> Ah, I missed that in the docs. Thanks. When I renamed it to tests.py >> it got picked up. >> >> But in the django/contrib dirs (e.g. django/contrib/auth)

Re: unit testing

2013-07-08 Thread ben
On Monday, July 8, 2013 7:49:53 AM UTC-4, larry@gmail.com wrote: > > > > Ah, I missed that in the docs. Thanks. When I renamed it to tests.py > it got picked up. > > But in the django/contrib dirs (e.g. django/contrib/auth) the tests > are in a tests sub dir and are not called tests.py

Re: unit testing

2013-07-08 Thread Larry Martell
On Sun, Jul 7, 2013 at 10:05 PM, Javier Guerra Giraldez wrote: > On Sun, Jul 7, 2013 at 10:47 PM, Larry Martell > wrote: >> MeasDataTest is declared as: >> >> class MeasDataTest(TestCase): >> >> Why do I get "does not refer to a test"? > > where do

Re: unit testing

2013-07-07 Thread Javier Guerra Giraldez
On Sun, Jul 7, 2013 at 10:47 PM, Larry Martell wrote: > MeasDataTest is declared as: > > class MeasDataTest(TestCase): > > Why do I get "does not refer to a test"? where do you define your test? AFAIR, it must be either in the models.py, or a tests.py file in the same

Re: unit testing

2013-07-07 Thread Larry Martell
On Sun, Jul 7, 2013 at 7:22 PM, Larry Martell <larry.mart...@gmail.com> wrote: > Just getting started with django unit testing. I created a very simple > test, just to see how things work. Here is my test: > > from django.test import TestCase > > fixtures = ['auth

unit testing

2013-07-07 Thread Larry Martell
Just getting started with django unit testing. I created a very simple test, just to see how things work. Here is my test: from django.test import TestCase fixtures = ['auth_user', 'auth_permission', 'data_cst'] class MeasDataTest(TestCase): def test_MeasDate(self): # login

Re: testing

2013-07-05 Thread Larry Martell
On Fri, Jul 5, 2013 at 6:38 AM, Ramiro Morales <cra...@gmail.com> wrote: > On Thu, Jul 4, 2013 at 8:42 PM, Larry Martell <larry.mart...@gmail.com> wrote: >> >> I'm just getting involved with setting up testing using the django >> testing facilities, and I have a c

Re: testing

2013-07-05 Thread Ramiro Morales
On Thu, Jul 4, 2013 at 8:42 PM, Larry Martell <larry.mart...@gmail.com> wrote: > > I'm just getting involved with setting up testing using the django > testing facilities, and I have a couple of questions. > > If I do this from the django shell: > > $ python manage.py sh

testing

2013-07-04 Thread Larry Martell
I'm just getting involved with setting up testing using the django testing facilities, and I have a couple of questions. If I do this from the django shell: $ python manage.py shell Python 2.7.2 (default, Oct 11 2012, 20:14:37) [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60

Re: Testing with complex database setups

2013-05-27 Thread Jani Tiainen
l.com> wrote: > > Hi, > > > > I've product that uses complex setup scripts - tens of SQL scripts that > > creates tables, views, complex triggers, grants permissions and such and > > finally populates database with some pre-data. > > > > So how I should

Re: Testing with complex database setups

2013-05-24 Thread akaariai
gt; So how I should proceed with unit testing with database like that, since some > operations rely heavily that there really exists all that trigger-function > mess in the database? So that I don't need everytime to start from the > scratch but from some known state of the db? I have s

Re: Testing with complex database setups

2013-05-23 Thread Drew Ferguson
Hi If I understand you correctly, you want to be able to initialise your database to a known state; https://docs.djangoproject.com/en/1.5/howto/initial-data/ is what you want I think - it also contains a link to this https://docs.djangoproject.com/en/1.5/topics/testing/overview/#topics-testing

Testing with complex database setups

2013-05-23 Thread Jani Tiainen
Hi, I've product that uses complex setup scripts - tens of SQL scripts that creates tables, views, complex triggers, grants permissions and such and finally populates database with some pre-data. So how I should proceed with unit testing with database like that, since some operations rely

Re: Testing put in django 1.5

2013-05-14 Thread Aaron Cannon
Try something like the following untested code: >From djanto.test.client import BOUNDARY, MULTIPART_CONTENT, encode_multipart ... encoded_data = encode_multipart({'someParameter':'someValue'}) response = self.c.put("/path/to/some/api", data=encoded_data,

Testing put in django 1.5

2013-05-14 Thread o_r
We are about to upgrade from django 1.3 to 1.5, and we are running into some problems with some of our tests. This used to work in 1.3: response=self.c.put("/path/to/some/api",{'someParameter':'someValue'},follow=True), but it doesn't in 1.5. There is a note about it in the docs that this has

Testing tastypie DELETE, sending data in the body

2013-04-13 Thread Daniel França
I'm trying to test a REST request using tastypie ResourceTestCase and api_client, but it has a different behaviour from using angular js, for example. The data sent for a DELETE request comes in GET parameters of the request using the api_client of ResourceTestCase of tastypie.. like if it was

Re: facebook/twitter sharing, and testing

2013-04-12 Thread sara ismail
with facebook, and >>> twitter. i was wondering how to test such a thing, like unit testing, >>> knowing that i implemented front end only, just an HTML file. >>> and i have another question, how can i take a post url, and make it the >>> link to be shared with f

Re: New to testing

2013-04-10 Thread Lachlan Musicman
On 11 April 2013 14:48, Lachlan Musicman wrote: >>> On 11/04/2013 2:02pm, Lachlan Musicman wrote: >>> >>> Inside your test class before writing tests you can have ... >>> >>> def setUp(self): >>> >>> jack = MaleAccountFactory() >>> jill =

Re: New to testing

2013-04-10 Thread Mike Dewhirst
On 11/04/2013 2:42pm, Lachlan Musicman wrote: On 11 April 2013 14:23, Mike Dewhirst wrote: On 11/04/2013 2:02pm, Lachlan Musicman wrote: Inside your test class before writing tests you can have ... def setUp(self): jack = MaleAccountFactory()

Re: New to testing

2013-04-10 Thread Lachlan Musicman
On 11 April 2013 14:42, Lachlan Musicman wrote: > On 11 April 2013 14:23, Mike Dewhirst wrote: >> On 11/04/2013 2:02pm, Lachlan Musicman wrote: >> >> Inside your test class before writing tests you can have ... >> >> def setUp(self): >> >>

Re: New to testing

2013-04-10 Thread Lachlan Musicman
On 11 April 2013 14:23, Mike Dewhirst wrote: > On 11/04/2013 2:02pm, Lachlan Musicman wrote: > > Inside your test class before writing tests you can have ... > > def setUp(self): > > jack = MaleAccountFactory() > jill = FemaleAccountFactory() > > def

Re: New to testing

2013-04-10 Thread Mike Dewhirst
On 11/04/2013 2:02pm, Lachlan Musicman wrote: Hi I'm new to testing. Not to Django. To my shame. I'm trying to test some m2m signals connections, so I have a Inside your test class before writing tests you can have ... def setUp(self): jack = MaleAccountFactory() jill

Re: New to testing

2013-04-10 Thread Shawn Milochik
Create a function with a name that *doesn't* start with "test" and you can easily do what you want. Then both tests can call it. -- 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,

New to testing

2013-04-10 Thread Lachlan Musicman
Hi I'm new to testing. Not to Django. To my shame. I'm trying to test some m2m signals connections, so I have a def test_parent_account_creation(self): jack = MaleAccountFactory() jill = FemaleAccountFactory() jack.parents.add(jill) self.assertIn(jill, jack.parents.all

Re: facebook/twitter sharing, and testing

2013-04-10 Thread Bill Freeman
site, where a user can post about a product that he/she wants to sell, >> and my part right now is sharing posts from the site with facebook, and >> twitter. i was wondering how to test such a thing, like unit testing, >> knowing that i implemented front end only, just an HTML file. >&g

Re: facebook/twitter sharing, and testing

2013-04-10 Thread sara ismail
rom the site with facebook, and > twitter. i was wondering how to test such a thing, like unit testing, > knowing that i implemented front end only, just an HTML file. > and i have another question, how can i take a post url, and make it the > link to be shared with facebook/twitter,

Re: Testing with a custom user model as a ForeignKey in Django 1.5

2013-03-28 Thread Felipe Coelho
one class with a ForeignKey to the user model as well. I can > certainly skip the tests which use that model or which touch the database, > but since this is a user registration app, being able to test it with other > user types is quite a requirement for me. > > >> Any sug

Re: Testing with a custom user model as a ForeignKey in Django 1.5

2013-03-18 Thread Felipe Coelho
is a user registration app, being able to test it with other user types is quite a requirement for me. > Any suggestions on how to improve Django's testing infrastructure to > handle custom User models would be gratefully accepted (especially if they > come with patches). It's still new code, so

Re: Testing with a custom user model as a ForeignKey in Django 1.5

2013-03-16 Thread Russell Keith-Magee
> "ModelWithForeign.user" must be a "User" instance. >> >> This is the file I'm using for testing: >> >> from django.conf import settings >> from django.contrib.auth import get_user_model >> from django.contrib.auth.tests.custom_user i

Re: Testing with a custom user model as a ForeignKey in Django 1.5

2013-03-16 Thread Felipe Coelho
est correctly > using custom user models. When I run the test case attached below, I > get this error: > > ValueError: Cannot assign "": > "ModelWithForeign.user" must be a "User" instance. > > This is the file I'm using for testing: > &

Testing with a custom user model as a ForeignKey in Django 1.5

2013-03-13 Thread Felipe Coelho
get this error: ValueError: Cannot assign "": "ModelWithForeign.user" must be a "User" instance. This is the file I'm using for testing: from django.conf import settings from django.contrib.auth import get_user_model from django.contrib.auth.tests

Re: Problem with testing Django sources

2013-03-11 Thread C. Kirby
in this case would be the time the test database thinks it is vs the time the request/response thinks it is vs the time python thinks it is. Chaim On Saturday, March 9, 2013 3:16:22 PM UTC-6, VVilku wrote: > > Hello, > I have problem with testing Django sources from Git. >

Testing multilingual site

2013-03-11 Thread galgal
I'm making a test for a model which has a field with language. How can I switch, using Client(), languages to test actions on various languages? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Problem with testing Django sources

2013-03-09 Thread VVilku
Hello, I have problem with testing Django sources from Git. When I use: * PYTHONPATH=.. /python runtests.py --settings=test_sqlite*(in Windows with Git Shell). I receive these errors: == FAIL: test_naturalday_uses_localtime

Problem with testing Django files (sources).

2013-03-09 Thread Paweł Więc
Hello, I have little problem with testing Django sources in Windows. I have fresh sources from "git clone". I used Git shell (sh.exe) from "Git Bash". When: *PYTHONPATH=.. /python.exe runtests.py --settings=test_sqlite* I

Re: Experiences with A/B testing?

2013-03-02 Thread sidmitra
Hi Tomas, I do have some experience. I would advise you to look at http://www.optimizely.com as an alternative first. It's definitely easier to setup. Ofcourse coding backend to do A/B tests is always much more flexible at the expense of a lot of effort. So over the past year i've

Experiences with A/B testing?

2013-03-01 Thread Tomás Solar Castro
Hi everyone I want to make some A/B testing. I've searched for how to do this with django, and I found some extensions: - django-lean https://github.com/suckaplease/django-lean (seems discontinued) - django-ab https://github.com/johnboxall/django-ab (seems discontinued) - waffle

Re: How can i run system level tests using djangos testing framework

2013-02-18 Thread Nikolas Stevenson-Molnar
True, but as far as I can tell, Django's testing framework seems to revolve around apps, and you need to group your system-wide test somewhere anyway, might as well be in an app. It doesn't need to have much, just a blank models.py file, and a tests.py with your tests. Alternatively, you could

Re: How can i run system level tests using djangos testing framework

2013-02-18 Thread calum mchaffie
I have thought about that, but would prefer not to if i can avoid it, seems alot of extras just for some tests On Tuesday, February 19, 2013 10:51:24 AM UTC+13, Nikolas Stevenson-Molnar wrote: > > How about creating a 'testing' app specifically for full-project tests? > > _Nik

Re: How can i run system level tests using djangos testing framework

2013-02-18 Thread Nikolas Stevenson-Molnar
How about creating a 'testing' app specifically for full-project tests? _Nik On 2/18/2013 1:48 PM, calum mchaffie wrote: > I want to be able to run my system level integration tests using > djangos LiveServerTestCase. > > It doesnt make sense to have the tests in the app as it us

How can i run system level tests using djangos testing framework

2013-02-18 Thread calum mchaffie
I want to be able to run my system level integration tests using djangos LiveServerTestCase. It doesnt make sense to have the tests in the app as it uses more than just the app. So my problem is how do i get django to run the tests when they are in the project folder (not the app)? -- You

Testing view's get_context_data(): why does MultipleObjectMixin.get_context_data() require "object_list" in kwargs?

2013-02-13 Thread benoit . bryon
i.e. avoid passing it as kwarg in BaseListView. * looks like BaseListView.object_list could be some property(get_queryset), doesn't it? Here are notes about the use-case that made me ask... **Am I asking the right questions?** My use case is to write tests for class-based views. I

Re: Django app custom settings testing

2013-01-05 Thread nkryptic
file, you could do: from django.conf import settings def load_settings(): g = globals() g['SETTING_X'] = getattr(settings, 'SETTING_X', 5) load_settings() Then, when testing and using override_settings, you can just call the load_settings function to get the changed values. You can do

Re: Django app custom settings testing

2013-01-04 Thread Pedro J. Aramburu
for testing purposes because I really don't need diffsettings, only the test suite "compatibility". The other way that people seem to do it is using getattr(settings, 'SETTING_X', default value) every time they need the setting but it seems to violate the DRY principle and then you

Re: Django app custom settings testing

2013-01-04 Thread nkryptic
ttings > so that diffsettings and other project level things (like testing) can see > them? That's my question. I've read something on a github repo but it seems > clunky and over-done. My main goal really is to change some settings on the > tests so I can test different scenar

Re: Django app custom settings testing

2013-01-03 Thread Pedro J. Aramburu
No, you're not, but, there isn't a way to load or inject the app settings so that diffsettings and other project level things (like testing) can see them? That's my question. I've read something on a github repo but it seems clunky and over-done. My main goal really is to change some settings

Re: Django app custom settings testing

2013-01-03 Thread Bill Freeman
This approach is only useful for modules that import app.settings and use things that it defines. It doesn't affect things that import settings from django.conf . Your app can import settings from app, and get your settings. That's not going to affect any other app. If you want to affect what

Django app custom settings testing

2013-01-02 Thread Pedro J. Aramburu
Hi, I'm having troubles using the override_settings decorator. The thing is I'm writing an app that has it's own settings and I'm doing it with the approach of putting a settings.py file on the app folder with something like this: from django.conf import settings from django.core.exceptions

Re: Error with unit testing with Raven.

2012-12-14 Thread xina towner
I've found the solution. The problem was that I was using the 'raven.contrib.django.middleware.Sentry404CatchMiddleware' so the Middleware was getting the 404 signals. I think that because of that the test were not receiving the signals so when in the test we were checking for 404 codes the tests

Error with unit testing with Raven.

2012-12-13 Thread xina towner
Hi, I'm trying to use Raven in order to send messages to my CI server. I had some tests that pass but suddenly they are failing. Does anyone knows why is that? Output: == ERROR: test_not_individual

Re: testing unique_together IntegrityError

2012-11-10 Thread Mike Dewhirst
On 11/11/2012 4:45pm, Mike Dewhirst wrote: Can anyone help with some unit test guidance please? How can I trap an IntegrityError in a test to prove unique_together is working? I'm modelling a company and multiple divisions. A solo division doesn't need a division.name so I'm allowing it to be

testing unique_together IntegrityError

2012-11-10 Thread Mike Dewhirst
Can anyone help with some unit test guidance please? How can I trap an IntegrityError in a test to prove unique_together is working? I'm modelling a company and multiple divisions. A solo division doesn't need a division.name so I'm allowing it to be blank. It's __unicode__() method returns

Re: Django testing strategy

2012-10-10 Thread Daniele Procida
ave produced so far: <https://github.com/evildmp/Arkestra/blob/develop/contacts_and_people/tests.py> At the moment, all the tests (they are testing methods on a particular set of models) are in a single class and even a single test function. I want to break them up, to make them more ma

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

Re: Django testing strategy

2012-10-05 Thread Josh Crompton
functional area or workflow that you want to start with. Preferably, this would be (relatively) self-contained. 2) Create the fixtures you need for testing that area. 3) Write some high-level integration tests that cover all the important workflows for your user. I'd use the built in test client

<    1   2   3   4   5   6   7   8   9   10   >