Headless testing

2016-10-12 Thread Nathan
Hi all,

Wondering if anyone has an suggestions for headless django testing - any 
configuration tips or links would be helpful.

My site is django 1.8 and we make extensive use of jquery on the frontend. 
Using phantomjs driver with liveserver test hasn't worked out well. 


-- 
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/822c423b-c8a0-469a-b5dc-2b6ec1977136%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Unit testing in django for django template

2016-10-12 Thread codemaster472
 How to Unit testing in django for django  template

  please any one help me???

-- 
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/c09dfbd9-82d3-4d08-832d-c1e00f78aeed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unit testing in django for django template

2016-10-12 Thread James Schneider
In general, you would request the page and inspect the rendered output.

https://docs.djangoproject.com/en/1.10/topics/testing/tools/#testing-responses

-James

On Wed, Oct 12, 2016 at 12:17 PM,  wrote:

>  How to Unit testing in django for django  template
>
>   please any one help me???
>
> --
> 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/c09dfbd9-82d3-4d08-832d-c1e00f78aeed%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/CA%2Be%2BciWuP9jO5f3VExVduCLck2wPAaCtEkXKa%2B%3DTgmLEVd8E5g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unit testing in django for django template

2016-10-12 Thread ludovic coues
Personally, I use lxml to check the presence of HTML element based on
xpath. Here is an exemple of how I do it:

from django.core.urlresolvers import reverse
from django.test import TestCase
from lxml import etree

class UserUrlTestCase(TestCase):
""" Test for the user app """

def test_login_view(self):
""" The view display a form with username and password fields """
rep = self.client.get(reverse('user:login'))
# No need to continue if we don't get a 200 OK
self.assertEqual(rep.status_code, 200)
# Use xpath to check presence of element
doc = etree.HTML(rep.content)
self.assertEqual(len(doc.findall('.//input[@name="username"]')), 1)
self.assertEqual(len(doc.findall('.//input[@name="password"]')), 1)


You'll need to install the package lxml for the import to work

2016-10-12 22:23 GMT+02:00 James Schneider :
> In general, you would request the page and inspect the rendered output.
>
> https://docs.djangoproject.com/en/1.10/topics/testing/tools/#testing-responses
>
> -James
>
> On Wed, Oct 12, 2016 at 12:17 PM,  wrote:
>>
>>  How to Unit testing in django for django  template
>>
>>   please any one help me???
>>
>> --
>> 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/c09dfbd9-82d3-4d08-832d-c1e00f78aeed%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/CA%2Be%2BciWuP9jO5f3VExVduCLck2wPAaCtEkXKa%2B%3DTgmLEVd8E5g%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

-- 
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/CAEuG%2BTaiByfaWQ1-C545PooEEtNL0FB6B3g2uWxb84Hz%3DqD4Rw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Windows users: do the line endings created by startproject/startapp matter?

2016-10-12 Thread Tim Graham
There's an old ticket [0] noting that startproject/app create files with 
Unix line endings, even on WIndows. My question is whether or not this 
matters. Some things I thought of:

I think version control programs like Git usually normalize line endings 
anyway.


The proposed change only applies to Python files that the template commands 
are rewriting, not to any other text-based files such as template files 
(the default project/app templates don't have any, but custom project/app 
templates might).


Does makemigrations (and any other management commands that write files) 
already have this behavior?

Thanks for your feedback so we can best spend our time.

[0] https://code.djangoproject.com/ticket/21046

-- 
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/d5fc3b13-39f7-486b-9b4b-9fce88ab4f2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Windows users: do the line endings created by startproject/startapp matter?

2016-10-12 Thread Mike Dewhirst

On 13/10/2016 10:43 AM, Tim Graham wrote:
There's an old ticket [0] noting that startproject/app create files 
with Unix line endings, even on WIndows. My question is whether or not 
this matters. Some things I thought of:


I think version control programs like Git usually normalize line 
endings anyway.



The proposed change only applies to Python files that the template 
commands are rewriting, not to any other text-based files such as 
template files (the default project/app templates don't have any, but 
custom project/app templates might).



Does |makemigrations| (and any other management commands that write 
files) already have this behavior?



Thanks for your feedback so we can best spend our time.

[0] https://code.djangoproject.com/ticket/21046


I haven't had any such problems. I develop on Windows and deploy on 
Linux. Editors and repos look after all that.


If I did have a problem I would consider it my own responsibility to 
choose a different set of tools to resolve it.


Not a Django issue IMO.

Cheers (and thanks!)

Mike


--
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/d5fc3b13-39f7-486b-9b4b-9fce88ab4f2e%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/d9501fbf-97f9-2690-9972-73892d46ab1e%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: Headless testing

2016-10-12 Thread Avraham Serour
Hi,

In Linux you can just use selenium chrome or firefox or anything and set up
xfvb for headless, I have no idea if such a thing is possible in windows.

In either you can set up a selenium server so the machine running the tests
will connect remotely to the machine running the browser, you can either
set up this on your own or use https://saucelabs.com/ as a service

On Wed, Oct 12, 2016 at 10:22 PM, Nathan  wrote:

> Hi all,
>
> Wondering if anyone has an suggestions for headless django testing - any
> configuration tips or links would be helpful.
>
> My site is django 1.8 and we make extensive use of jquery on the frontend.
> Using phantomjs driver with liveserver test hasn't worked out well.
>
>
> --
> 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/822c423b-c8a0-469a-b5dc-2b6ec1977136%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/CAFWa6t%2BApoeEbo8OV7ExRhhO97kLhfQVqGDEoTM1nRgF4ueEJQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Headless testing

2016-10-12 Thread Mike Dewhirst
There is also BuildBot which can be programmed to do anything on 
multiple client/slaves running any OS


http://buildbot.net/

On 13/10/2016 1:09 PM, Avraham Serour wrote:

Hi,

In Linux you can just use selenium chrome or firefox or anything and 
set up xfvb for headless, I have no idea if such a thing is possible 
in windows.


In either you can set up a selenium server so the machine running the 
tests will connect remotely to the machine running the browser, you 
can either set up this on your own or use https://saucelabs.com/ as a 
service


On Wed, Oct 12, 2016 at 10:22 PM, Nathan > wrote:


Hi all,

Wondering if anyone has an suggestions for headless django testing
- any configuration tips or links would be helpful.

My site is django 1.8 and we make extensive use of jquery on the
frontend. Using phantomjs driver with liveserver test hasn't
worked out well.Â


-- 
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/822c423b-c8a0-469a-b5dc-2b6ec1977136%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/CAFWa6t%2BApoeEbo8OV7ExRhhO97kLhfQVqGDEoTM1nRgF4ueEJQ%40mail.gmail.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/c43137d9-8d27-e677-516b-14ae887c463e%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.