Re: How to use selenium automated testing in django projects

2016-02-27 Thread Dan Tagg
Harry Percival is very good http://www.obeythetestinggoat.com Not sure if he covers Excel Dan On 27 Feb 2016 13:22, "Vikneswaran S J" <vickyrahul...@gmail.com> wrote: > I need to use selenium automated testing for django application with input > from excel sheet. How t

How to use selenium automated testing in django projects

2016-02-27 Thread Vikneswaran S J
I need to use selenium automated testing for django application with input from excel sheet. How to use use this feature? any idea? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving e

Re: Tutorial 5 (Testing) seems to have an error

2016-02-15 Thread Tim Graham
It looks like you have a Python path problem or that your project isn't structured correctly such that the model is being registered twice. Does that mean anything to you? I'm not sure if you are also new to Python or just to Django. On Monday, February 15, 2016 at 11:16:51 AM UTC-5, Eric

Tutorial 5 (Testing) seems to have an error

2016-02-15 Thread Eric Livingston
I have been walking through the Tutorial for Django, and upon reaching part 5 and introducing the first test case, I get this output (the directory I put the tutorial in is called 'demo') RuntimeError: Model class demo.polls.models.Question doesn't declare an explicit app_label and isn't

Re: Testing the interaction of multiple sites

2016-01-04 Thread Nikolas Stevenson-Molnar
On Monday, January 4, 2016 at 3:39:22 PM UTC-8, Michal Petrucha wrote: > > Hi Nikolas, > > Thanks for your suggestion, unfortunately, I don't see how it helps in > my case. > > What I'm after is some kind of integration test: when I try to load a > page form the relying instance, verify that

Re: Testing the interaction of multiple sites

2016-01-04 Thread Michal Petrucha
On Mon, Jan 04, 2016 at 03:22:10PM -0800, Nikolas Stevenson-Molnar wrote: > HTTPretty may help with this. It will let you mock a response from the > second server: https://github.com/gabrielfalcao/httpretty > > _Nik Hi Nikolas, Thanks for your suggestion, unfortunately, I don't see how it

Re: Testing the interaction of multiple sites

2016-01-04 Thread Nikolas Stevenson-Molnar
to have both the provider and the relying instance > listening at the same time. > > Is there a simple mechanism to have LiveServerTestCase run two > separate server threads with different settings? Is there some kind of > third-party testing package that can do that? > > Chee

Re: Testing the interaction of multiple sites

2016-01-04 Thread Nikolas Stevenson-Molnar
e same time. Is there a simple mechanism to have LiveServerTestCase run two separate server threads with different settings? Is there some kind of third-party testing package that can do that? Cheers, and have a happy New Year. Michal -- You received this message because you are subscribed to the

Testing the interaction of multiple sites

2016-01-04 Thread Michal Petrucha
, I'd need to have both the provider and the relying instance listening at the same time. Is there a simple mechanism to have LiveServerTestCase run two separate server threads with different settings? Is there some kind of third-party testing package that can do that? Cheers, and have a happy New

Re: testing django migrations

2015-12-27 Thread Gergely Polonkai
I'm also interested in that, except that I'd like to test RunPython steps. On Dec 28, 2015 12:32 AM, "Dan Tagg" wrote: > Hi, > > I used this: > https://github.com/plumdog/django_migration_testcase > > It's only worth writing tests if you are modifying code created by

Re: testing django migrations

2015-12-27 Thread Dan Tagg
Hi, I used this: https://github.com/plumdog/django_migration_testcase It's only worth writing tests if you are modifying code created by makemigrations. Dan On 27 December 2015 at 10:14, varun naganathan wrote: > Hi,I wanted to know how am i supposed to test

testing django migrations

2015-12-27 Thread varun naganathan
Hi,I wanted to know how am i supposed to test the working of django migrations.As in how the migrations generate the SQL query.Basically I want to inspect how the sql query generated as in the output of "./manage.py sqlmigrate" is being generated.I've generally used "pdb" along wth

How do you approach unit testing for pluggable apps?

2015-12-21 Thread Nan
of project context? If so, how would you handle testing operations that require database access? -- 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 dj

Testing if app has automatically logged out.

2015-12-03 Thread Meg Bledsoe
ngs, but I don't have much experience with testing. This is what I have, but I don't know how to fix it. class AutoLogoutTest(unittest.TestCase): def setUp(self): self.loggedout = AutoLogout() self.request = Mock() self.client = Client() self.u

Re: Unit testing for apis

2015-11-24 Thread David Palao
...@gmail.com>: > Hi All, > > How can I write negative unit test cases for api endpoints > I am using django.tests.TestCase for unit testing. > > Thanks, > Kishan > > -- > You received this message because you are subscribed to the Google Groups > "Django u

Unit testing for apis

2015-11-24 Thread Kishan Mehta
Hi All, How can I write negative unit test cases for api endpoints I am using django.tests.TestCase for unit testing. Thanks, Kishan -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiv

Re: Creating the testing db fails (django 1.8.5)

2015-10-15 Thread Uwe Schuerkamp
> > I solved it myself... looks like I forgot to create the initial migrations > for the app. After running > python manage.py makemigrations club300 python manage.py migrate --fake-initial python manage.py test club300 appears to work fine. Sorry for the noise & thanks for your help! Uwe

Re: Creating the testing db fails (django 1.8.5)

2015-10-15 Thread Uwe Schuerkamp
Here's some more info in case it helps: The "manage.py test" call seems to get as far as creating the table "django_migrations", then things break. The production DB has several more tables (25 in all) I'm not seeing in the output below, so I guess this issue must be related to the migrations

Re: Creating the testing db fails (django 1.8.5)

2015-10-15 Thread Uwe Schuerkamp
> > Hi Mike, > thanks for your quick reply. I tried deleting the test database, but that didn't help either (actually I tried this several times before I posted here, I even set up a "fresh" production database on my test machine and re-imported the live data in order to solve the problem).

Re: Creating the testing db fails (django 1.8.5)

2015-10-15 Thread Mike Dewhirst
t;pip" MariaDB 5.5.44 I'm trying to set up a test framework for a little internal project which I've been working on since the Django 1.3 days. I've recently migrated the project to Django 1.8.4/5 via Django 1.7, and everything appears to be working fine. Trying to set up a testing framework for

Creating the testing db fails (django 1.8.5)

2015-10-14 Thread Uwe Schuerkamp
up a test framework for a little internal project which I've been working on since the Django 1.3 days. I've recently migrated the project to Django 1.8.4/5 via Django 1.7, and everything appears to be working fine. Trying to set up a testing framework for the first time to get out of my bad "non

Re: Django Live Site to Localhost (Testing)

2015-08-25 Thread Gergely Polonkai
ed Django Site running on live, But it never > had a testing environment. Now, I downloaded all the files of Website and > download a mysql dump file. > I want to run this on my local machine windows (Just to push my changes > here to test before going live). > I installed all requi

Re: Django Live Site to Localhost (Testing)

2015-08-25 Thread Bhadreshsinh Gohil
ter.com/GTUPGSchool> ] *Website:* GTUPGSchool <http://knowyourcollege.in/CollegeBasic.aspx?CollegeCode=8211> & *MOODLE:* @e-learning <http://pgschool.gtu.ac.in/moodle/> On Thu, Aug 20, 2015 at 8:10 PM, <bh...@diamondyarn.com> wrote: > We have a completely developed Django Sit

Django Live Site to Localhost (Testing)

2015-08-20 Thread bhanu
We have a completely developed Django Site running on live, But it never had a testing environment. Now, I downloaded all the files of Website and download a mysql dump file. I want to run this on my local machine windows (Just to push my changes here to test before going live). I installed

Testing Signals

2015-08-11 Thread Grant Means
I have an app that fires a custom signal when a specific method is called. I wrote a test that connects to the signal in setUp() and uses a local listener function to set a class attribute to True if the handler is called. You can see the relevant code here: https://dpaste.de/mAGw This works

Re: Testing related models without saving

2015-07-30 Thread Michael Herrmann
ct to a ForeignKey/OneToOneField attribute; in production >>> code that would almost always be a bug. Personally, though, I've never >>> been bitten by that bug, I'm confident I could easily find and fix such >>> a bug if I did write it, and I don't want to give up the abi

Re: Testing related models without saving

2015-07-30 Thread Tim Graham
e; in production >> code that would almost always be a bug. Personally, though, I've never >> been bitten by that bug, I'm confident I could easily find and fix such >> a bug if I did write it, and I don't want to give up the ability to use >> related unsaved models in tes

Re: Testing related models without saving

2015-07-30 Thread michael
eToOneField with `allow_unsaved_instance_assignment = > True` set on them (essentially reverting the safety change in 1.8). I > haven't attempted to switch it on dynamically for testing; that should > be possible using a setting and a custom subclass, but I wouldn't choose > to do that;

Re: Testing related models without saving

2015-07-16 Thread Carl Meyer
subclasses of ForeignKey and OneToOneField with `allow_unsaved_instance_assignment = True` set on them (essentially reverting the safety change in 1.8). I haven't attempted to switch it on dynamically for testing; that should be possible using a setting and a custom subclass, but I wouldn't

Re: Testing related models without saving

2015-07-16 Thread Roland Swingler
> i'll just say that Django tests don't favor too much into the "unit" test spectrum; That is what I'm seeing - it is the same with rails out of the box as well. I guess I'm just curious to know whether: a) the 'unit' test end of the spectrum is feasible if that's what you like b) what is

Re: Testing related models without saving

2015-07-16 Thread Javier Guerra Giraldez
On Thu, Jul 16, 2015 at 8:18 AM, Roland Swingler <roland.swing...@gmail.com> wrote: > I understand that the test db uses a different schema (it's the same in > rails), the point is to be able to run tests isolated from having a database > at all. there are several testing s

Re: Testing related models without saving

2015-07-16 Thread Roland Swingler
Hi, Thanks for the link - I'll investigate that further, especially as to whether you can set that dynamically. I understand that the test db uses a different schema (it's the same in rails), the point is to be able to run tests isolated from having a database at all. Thanks, Roland -- You

Re: Testing related models without saving

2015-07-16 Thread Bruno A.
s background, and > struggling to do unit testing of Django models without saving to the > database as I'm used to in Rails. Lets say you have 2 linked models, for > example User and UserProfileDetails, then in my tests I want to set up the > structure and not save any of

Re: Testing related models without saving

2015-07-16 Thread Bruno A.
t; > I've very recently come to to Django from a rails background, and > struggling to do unit testing of Django models without saving to the > database as I'm used to in Rails. Lets say you have 2 linked models, for > example User and UserProfileDetails, then in my tests I want to se

Testing related models without saving

2015-07-16 Thread Roland Swingler
Hi all, I've very recently come to to Django from a rails background, and struggling to do unit testing of Django models without saving to the database as I'm used to in Rails. Lets say you have 2 linked models, for example User and UserProfileDetails, then in my tests I want to set up

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

Re: Testing a new app

2015-05-28 Thread Bill Freeman
If the "new" app doesn't need services from the larger app in order t work, but rather the other way around, why not leave it separate, and later, just make it an install requirement for the larger app? On Thu, May 28, 2015 at 5:54 AM, Klaas Feenstra wrote: > Using GIT would

Re: Testing a new app

2015-05-28 Thread Klaas Feenstra
Using GIT would be the way of working.. On Thu, May 28, 2015 at 4:24 AM, DZ wrote: > Greetings, > > I want to start a new app that if it works out I will tie into a larger > django app. I do not really want the worlds to mix at the start just in > case I need scrap

Testing a new app

2015-05-28 Thread DZ
Greetings, I want to start a new app that if it works out I will tie into a larger django app. I do not really want the worlds to mix at the start just in case I need scrap and start it over a few times. I was thinking the best approach would be to create this first as a stand alone app and

Re: Testing Setup gives 500, but dev server works okay

2015-05-25 Thread Timothy W. Cook
I should add that the actual error is: selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: {"method":"id","selector":"id_login"} because the main page never loads so it can't find the login button, On Mon, May 25, 2015 at 12:29 PM, Timothy W. Cook

Testing Setup gives 500, but dev server works okay

2015-05-25 Thread Timothy W. Cook
I have a project that I started, then decided I should apply a TDD approach. Well the user registration and login portion already works but I am attempting to add some tests to it. The user can register, is redirected back to the main page with a Login button. Here is the test code: def

Re: How do I patch django.core.mail.send_mail for testing?

2015-05-19 Thread Stephen J. Butler
I think you instead want to use self.modify_settings() or self.override_settings() to change EMAIL_BACKEND to locmem: https://docs.djangoproject.com/en/1.8/topics/email/#in-memory-backend Then you can inspect django.core.mail.outbox to verify recipients, message, etc. On Tue, May 19, 2015 at

How do I patch django.core.mail.send_mail for testing?

2015-05-19 Thread Andrew Farrell
Hi folks, I'm trying to use mock.patch to test that a particular post-save signal kicks off an email. My current approach to this is... from django.test import TestCase from mock import patch class RegisterTestCase(TestCase):

Re: Testing request parameters in Django (“+” behaves differently)

2015-04-20 Thread Eneko Illarramendi
lt;eneko.ill...@gmail.com > wrote: > > Previously posted in SO: > > > http://stackoverflow.com/questions/29703930/testing-request-parameters-in-django-behaves-differently > > > --- > > > > I have a Django View that uses a query par

Re: Testing request parameters in Django (“+” behaves differently)

2015-04-20 Thread Tom Evans
On Sat, Apr 18, 2015 at 12:13 PM, Eneko Illarramendi <eneko.illarrame...@gmail.com> wrote: > Previously posted in SO: > http://stackoverflow.com/questions/29703930/testing-request-parameters-in-django-behaves-differently > --- > > I have a Django V

Testing request parameters in Django (“+” behaves differently)

2015-04-18 Thread Eneko Illarramendi
*Previously posted in SO: http://stackoverflow.com/questions/29703930/testing-request-parameters-in-django-behaves-differently* --- I have a Django View that uses a query parameter to so some content filtering. Something like this: /page/?filter=one+and+two/page/?filter

Re: Data migration script populating db table - testing

2015-03-23 Thread Filipe Ximenes
One way to do it is to run all operations, don't call "save" and verify "manually" if objects are correct. I don't know about other methods, but if someone else does it would be great. On Sun, Mar 22, 2015 at 6:29 AM, Murthy Sandeep wrote: > Hi > > I have created an

Data migration script populating db table - testing

2015-03-22 Thread Murthy Sandeep
Hi I have created an data migration script for populating one of app db tables with data from a JSON file. First I ran python manage.py makemigrations --empty TPP_App (‘TPP_App’ is the name of my app) and then I added a custom method called populate_db which will use bulk_create to add

Testing migrations

2015-03-20 Thread Gergely Polonkai
Hello, I just wrote a migration class with RunPython. When I run my tests, my coverage value drops to to ninety-something percents, because the initial database created by the test runner is (obviously) empty, thus, my migration function’s for iteration won’t run. Is there a way to test such

Re: Testing Django: testing template at different time

2015-03-18 Thread Zaki Akhmad
me, finally I managed to get the testing. I put my code snippets here https://gist.github.com/za/2a217c47582737f88259 > Or, you could say something like: > if 9 <= datetime.datetime.now().hour < 17: > self.assertContains(response, "It's working time!") > else: &

Re: Testing template context processors

2015-03-17 Thread Gergely Polonkai
] for middleware testing, funny that I didn't think of this way (especially as I implemented it today), so thanks for pointing out! [2] https://pypi.python.org/pypi/mock On 17 Mar 2015 17:59, "Carl Meyer" <c...@oddbird.net> wrote: > Hi Gergely, > > On 03/17/2015 10:52 AM, Gerg

Re: Testing template context processors

2015-03-17 Thread Carl Meyer
Hi Gergely, On 03/17/2015 10:52 AM, Gergely Polonkai wrote: > I wrote a context processor which makes some global variables of mine > available for templates. I cannot find a good (cough… any) article on > how to test such processors. Could you give me some directions on where > to start with

Testing template context processors

2015-03-17 Thread Gergely Polonkai
Hello, I wrote a context processor which makes some global variables of mine available for templates. I cannot find a good (cough… any) article on how to test such processors. Could you give me some directions on where to start with writing one? Thanks in advance! Best, Gergely -- You

Testing Migrations (django 1.7)?

2015-03-16 Thread Sean Briceland
Hi all, Previous to Django 1.7, I had a nifty solution for testing south Migrations. I'd basically get a list of migrations for an app via: migrations = Migrations('some_app') Then to get the ORM at a given point in migrations: orm_at_migration = migrations['000X_name_of_migration'].orm() I

Re: Testing Django: testing template at different time

2015-03-12 Thread Collin Anderson
e test code that will check the within and not within > business hour in one file that both will success whenever I run the > test code? > > [1] > https://docs.djangoproject.com/en/1.7/topics/testing/tools/#testing-responses > > Thanks, > > -- > Zaki Akhmad

Testing Django: testing template at different time

2015-03-11 Thread Zaki Akhmad
n and not within business hour in one file that both will success whenever I run the test code? [1]https://docs.djangoproject.com/en/1.7/topics/testing/tools/#testing-responses Thanks, -- Zaki Akhmad -- You received this message because you are subscribed to the Google Groups "Django users&quo

Re: Writing your first Django app, part 5 Testing

2015-02-21 Thread Gavin Patrick McCoy
Ok. I get you. Thanks very much! On Saturday, 21 February 2015 11:56:50 UTC, Daniel Roseman wrote: > > You're doing this in the shell, which uses your devv database in which you > have obviously defined a poll already. > > The docs are taking about running this in a unit test, which would

Re: Writing your first Django app, part 5 Testing

2015-02-21 Thread Gavin Patrick McCoy
I got a code 200. Thanks for your reply. On Saturday, 21 February 2015 11:05:35 UTC, 严超 wrote: > > I think the purpose here is to test reverse() function. As long as you > got code 200, it's ok whatever html it returns. > Is it right ? > > *Best Regards!* > > > *Chao Yan--About me :

Writing your first Django app, part 5 Testing

2015-02-21 Thread Daniel Roseman
You're doing this in the shell, which uses your devv database in which you have obviously defined a poll already. The docs are taking about running this in a unit test, which would create a blank db without any polls. -- DR. -- You received this message because you are subscribed to the

Re: Writing your first Django app, part 5 Testing

2015-02-21 Thread 严超
I think the purpose here is to test reverse() function. As long as you got code 200, it's ok whatever html it returns. Is it right ? *Best Regards!* *Chao Yan--About me : http://about.me/chao_yan * *My twitter: @yanchao727 *

Writing your first Django app, part 5 Testing

2015-02-21 Thread Gavin Patrick McCoy
Hi, I'm on part 5 of the polls tutorial (https://docs.djangoproject.com/en/1.7/intro/tutorial05/) and I am running Django 1.7 and Python 3.4 on Windows 8. Just want to make sure I'm on the right track. For the following part of tutorial: >>> # get a response from '/'>>> response =

Re: Testing posts to S3

2015-02-11 Thread Tom Evans
On Wed, Feb 11, 2015 at 7:36 PM, Lee Hinde wrote: > I'm using django storages/boto to push json files to s3 where they are to be > read by a different app. > > I'd like to test the file push by using the Test Client to see if the file > is present on S3. > > client = Client()

Testing posts to S3

2015-02-11 Thread Lee Hinde
I'm using django storages/boto to push json files to s3 where they are to be read by a different app. I'd like to test the file push by using the Test Client to see if the file is present on S3. client = Client() r = client.get(url, content_type="application/json") In every case, r comes back

Re: Testing reusable application: compatible way

2014-12-07 Thread Carl Meyer
On 12/07/2014 12:59 PM, Matwey V. Kornilov wrote: > The following code works perfect for me, why the code in the > documentations so sophisticated? > > def runtests(): > os.environ.setdefault("DJANGO_SETTINGS_MODULE", > "tests.test_settings") > > try: > from

Re: Testing reusable application: compatible way

2014-12-07 Thread Carl Meyer
On 12/07/2014 02:28 PM, Carl Meyer wrote: > On 12/07/2014 08:40 AM, Matwey V. Kornilov wrote: >> I've followed this documentation: >> https://docs.djangoproject.com/en/1.7/topics/testing/advanced/#using-the-django-test-runner-to-test-reusable-applications >> and found that it

Re: Testing reusable application: compatible way

2014-12-07 Thread Carl Meyer
Hi Matwey, On 12/07/2014 08:40 AM, Matwey V. Kornilov wrote: > I've followed this documentation: > https://docs.djangoproject.com/en/1.7/topics/testing/advanced/#using-the-django-test-runner-to-test-reusable-applications > and found that it works only for Django 1.7, whereas I w

Re: Testing reusable application: compatible way

2014-12-07 Thread Matwey V. Kornilov
ey V. Kornilov написал: > > Hi, > > I've followed this documentation: > https://docs.djangoproject.com/en/1.7/topics/testing/advanced/#using-the-django-test-runner-to-test-reusable-applications > and found that it works only for Django 1.7, whereas I would like to have > a code sn

Testing reusable application: compatible way

2014-12-07 Thread Matwey V. Kornilov
Hi, I've followed this documentation: https://docs.djangoproject.com/en/1.7/topics/testing/advanced/#using-the-django-test-runner-to-test-reusable-applications and found that it works only for Django 1.7, whereas I would like to have a code snipped working also for 1.5, 1.6. An issue

Re: Unit-testing Custom Admin Action, requires request and querysets parameters.

2014-11-25 Thread Azam Alias
Hi Collin, I apologise for the late update. Didnt get any notifications from your reply. I have solved this issue as per your suggestion. Pasting the solution for others' reference. Thanks ! from django.test import TestCase from django.contrib.admin.sites import AdminSite from

Re: Warning / Error when testing with W flag

2014-11-21 Thread Collin Anderson
It looks like it's fixed for python 3.4 on master (the fix will eventually be in django 1.8) On Wednesday, November 19, 2014 10:15:00 AM UTC-5, Carl Meyer wrote: > > Hi Daniel, > > On 11/18/2014 02:01 AM, Daniel Grace wrote: > > Hi, > > I get another warning / error with a test command as

Re: Warning / Error when testing with W flag

2014-11-19 Thread Carl Meyer
Hi Daniel, On 11/18/2014 02:01 AM, Daniel Grace wrote: > Hi, > I get another warning / error with a test command as follows: >>python -W error manage.py test flow > Traceback (most recent call last): > File "manage.py", line 8, in > from django.core.management import

Warning / Error when testing with W flag

2014-11-18 Thread Daniel Grace
Hi, I get another warning / error with a test command as follows: >python -W error manage.py test flow Traceback (most recent call last): File "manage.py", line 8, in from django.core.management import execute_from_command_line File

Re: Unit-testing Custom Admin Action, requires request and querysets parameters.

2014-11-05 Thread Collin Anderson
Hello, Would it work to import AppAdmin, instantiate it, and then call the methods in a unit test? Collin -- 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

Unit-testing Custom Admin Action, requires request and querysets parameters.

2014-11-02 Thread Azam Alias
Hi, I would like to unit-test the activate_apps( ) and deactivate_apps( ) functions below, as low-level as possible. How could I do this without going through Selenium (FT) route? In my admin.py: from django.contrib import admin from my_app_listing.models import App class

Re: Django Tutorial #5 Testing: return Poll.objects.filter( SyntaxError: 'return' outside function

2014-09-16 Thread Andy McKay
You've got a syntax error in your code, likely wherever you have "return Poll.objects.filter(" in your code. "Outside a function" likely means that you have not correctly indented your code, for example if your return has no indentation. Whitespace in Python is significant and is part of the

Django Tutorial #5 Testing: return Poll.objects.filter( SyntaxError: 'return' outside function

2014-09-16 Thread Thomas George
Hello, I was tooling along in the 1.6 tutorial quite well when I came across this error, and I'm not sure what to make of it: return Poll.objects.filter( SyntaxError: 'return' outside function The test.py (below) is failing 9 of 12 tests with this error: *import datetime* *from django.utils

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?

Re: Unit testing - self.assertEqual("Break it!", resp.content)

2014-07-07 Thread Pepsodent Cola
Hi, I have been using assertEqual lately in my unit testing to deliberately make coverage break. By comparing *Something False* with the complete HTML returned (*resp.content*). self.assertEqual("Something False", *resp.content*) In order to reveal and debug the

Re: Unit testing - self.assertEqual("Break it!", resp.content)

2014-07-06 Thread Mitesh Patel
Hi, You are trying to compare break it! with the complete HTML returned. Instead of assertEqual, use assertIn. self.assertIn("Break it!", resp.content) Regards, Mitesh On 7 Jul 2014 01:44, "Pepsodent Cola" wrote: > When I run this unit test to make it break so it

Unit testing - self.assertEqual("Break it!", resp.content)

2014-07-06 Thread Pepsodent Cola
When I run this unit test to make it break so it can output a bunch of html data. self.assertEqual("Break it!", *resp.content*) test.py # Reset password no login def test_Reset_no_login(self): self.assertTrue(isinstance(self.user, User)) login =

Unit testing - return HttpResponseRedirect('/accounts/loggedin')

2014-07-04 Thread Pepsodent Cola
Hi coverage has highlighted that I have no unit test for the line, regarding *HttpResponseRedirect('/accounts/loggedin')*. How can I write a test that makes Coverage happy regarding this? views.py def auth_view(request): username = request.POST.get('username', '') password =

Re: Unit testing - self.assertEqual(login, True)

2014-07-03 Thread Pepsodent Cola
(self.user, User)) login = self.client.login(username='captain', password='america') self.assertEqual(login, True) https://docs.djangoproject.com/en/1.5/intro/tutorial05/#testing-our-new-view class UserProfileTest(TestCase): *# User factory method* def create_user(self, username

Re: Unit testing - self.assertEqual(login, True)

2014-07-03 Thread Amim Knabben
duplicated question https://groups.google.com/forum/#!topic/django-users/I4wmYKNMNn8 On Thu, Jul 3, 2014 at 9:09 AM, Pepsodent Cola wrote: > I want to run a unit test for a user logging in but I get error. What am > I doing wrong? > > > from django.test import

Unit testing - self.assertEqual(login, True)

2014-07-03 Thread Pepsodent Cola
I want to run a unit test for a user logging in but I get error. What am I doing wrong? from django.test import TestCase from userprofile.models import UserProfile from django.contrib.auth.models import User class UserProfileTest(TestCase): # User factory method def create_user(self,

Re: testing equality in template tag

2014-06-26 Thread Tom Evans
On Wed, Jun 25, 2014 at 7:34 PM, Lee Hinde wrote: > with view code like so: > > import calendar > months_choices = [] > for i in range(1,13): > months_choices.append((i, calendar.month_name[i])) > context['months'] = months_choices >

Re: testing equality in template tag

2014-06-26 Thread Roman Klesel
Ugh , sorry of course we know ... forget what i said ... 2014-06-26 9:48 GMT+02:00 Roman Klesel : > hard to tell since we do not know what values default_month and month.0 have > ... > try to print in the view and examine: > print type(month[0]), month[0],

Re: testing equality in template tag

2014-06-26 Thread Roman Klesel
hard to tell since we do not know what values default_month and month.0 have ... try to print in the view and examine: print type(month[0]), month[0], type(today.month), today.month 2014-06-25 20:34 GMT+02:00 Lee Hinde : > with view code like so: > > import calendar >

testing equality in template tag

2014-06-25 Thread Lee Hinde
with view code like so: import calendar months_choices = [] for i in range(1,13): months_choices.append((i, calendar.month_name[i])) context['months'] = months_choices and context['default_month'] = today.month I have this snippet in a template (my

Re: Expected URL with primary key when testing SimpleTestCase.assertRedirects()

2014-06-18 Thread Antonio Alaniz
. I'm going move some of this work around between functional and unit tests and then try out your suggestion with the client. Tony On Tuesday, June 17, 2014 7:26:27 PM UTC-7, Antonio Alaniz wrote: > > I'm testing a redirect that would include the primary key. Can anyone tell > me how I

Re: Expected URL with primary key when testing SimpleTestCase.assertRedirects()

2014-06-18 Thread Kelvin Wong
=[pizza.id]) Here is the complete app's tests if you want to take a look https://github.com/kelvinwong-ca/django-select-multiple-field/blob/master/test_projects/django14/pizzagigi/tests.py K On Tuesday, June 17, 2014 7:26:27 PM UTC-7, Antonio Alaniz wrote: > > I'm testing a redirect that

Expected URL with primary key when testing SimpleTestCase.assertRedirects()

2014-06-17 Thread Antonio Alaniz
I'm testing a redirect that would include the primary key. Can anyone tell me how I can test the redirect URL if it involves the primary key? Will the following work?: self.assertRedirects(response, 'message/(?P\d+)/', 200) -- You received this message because you are subscribed to the Google

Re: newcomer to django testing

2014-06-09 Thread Andromeda Yelton
d the problem ... > > Thanks mate > > > 2014-06-08 15:39 GMT+01:00 Esau Rodriguez <esa...@gmail.com>: > > 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?

Re: newcomer to django testing

2014-06-08 Thread monoBOT
the problem ... Thanks mate 2014-06-08 15:39 GMT+01:00 Esau Rodriguez <esa...@gmail.com>: > 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 R

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 <monobot.s...@gmail.com> wrote: > Im new on testing ... to

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

Re: why does django user require create database privlages for testing

2014-04-23 Thread Alex Mandel
admin user, creating a db and auth for access to that db. Thanks, Alex On 04/23/2014 01:51 PM, Bill Freeman wrote: > Because virtually all of us don't want our production database used for > testing. > > > On Wed, Apr 23, 2014 at 4:18 PM, dacresni <vivacar...@gmail.com> wrote: >

Re: why does django user require create database privlages for testing

2014-04-23 Thread Bill Freeman
Because virtually all of us don't want our production database used for testing. On Wed, Apr 23, 2014 at 4:18 PM, dacresni <vivacar...@gmail.com> wrote: > Rails doesn't require this, you create a test database as super user and > it uses it for testing. Why doesn't

why does django user require create database privlages for testing

2014-04-23 Thread dacresni
Rails doesn't require this, you create a test database as super user and it uses it for testing. Why doesn't django allow this? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving e

Testing Multiple Sequential Forms in one Test Function

2014-03-03 Thread James P
processing (ie. the FormWizard 'done' method launches and performs this work) But when I try to run it via the testing functions, I can POST multiple forms sequentially but they never seem to be on the same session or kick off the 'done' method. Is there something I am missing to testing multiple

Browser-based automated testing with a separate test DB

2014-02-17 Thread Peter Kehl
If you're interested in convenient, browser-based automated testing, you may want to look at SeLite. It extends Selenium IDE. It allows your tests to access (read and write to) a test DB (isolated from the DB of the tested application). It's especially good for Django applications, which can

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