Re: Query annotation with date difference

2016-07-31 Thread Constantine Covtushenko
Hi Yoann, I am not sure exactly but believes you are on the right way. Try improve your expression with ExpressionWrapper, as said here . Probably the problem is that you use values of different types in your

Re: Testing if a view have an html element with at least one attribute

2016-07-31 Thread Andreas Kuhne
2016-07-31 12:38 GMT+02:00 ludovic coues : > Hello, > > I am trying to test if a view is displaying a form with an input > element with name=username. > > Currently, I have tried a lot of variation around > `self.assertContains( response, "", > html=True)` but none work. > I

Re: Testing if a view have an html element with at least one attribute

2016-07-31 Thread ludovic coues
First, thanks for the suggestion. I just tried that, didn't work. Here is the test file I used: from django.test import TestCase class HTMLTestCase(TestCase): def test_input_in_fieldset(self): fieldset = """ """

Testing if a view have an html element with at least one attribute

2016-07-31 Thread ludovic coues
Hello, I am trying to test if a view is displaying a form with an input element with name=username. Currently, I have tried a lot of variation around `self.assertContains( response, "", html=True)` but none work. I assume that doesn't work because the view have a field input with name=username

Re: Testing if a view have an html element with at least one attribute

2016-07-31 Thread Andreas Kuhne
2016-07-31 13:56 GMT+02:00 ludovic coues : > First, thanks for the suggestion. > > I just tried that, didn't work. > Here is the test file I used: > > > from django.test import TestCase > > class HTMLTestCase(TestCase): > > def test_input_in_fieldset(self): >

Re: Testing if a view have an html element with at least one attribute

2016-07-31 Thread ludovic coues
Oh, sorry. A bit of misunderstanding and miscommunication on my part. The exemple I gave is just a quick way to reproduce my problem. The real test use self.client, reverse, cast response.content to a string. What I gave is a minimal exemple. Also, I assumed you talked about comparing bit of

Re: Testing if a view have an html element with at least one attribute

2016-07-31 Thread Andreas Kuhne
2016-07-31 15:59 GMT+02:00 ludovic coues : > Oh, sorry. A bit of misunderstanding and miscommunication on my part. > > The exemple I gave is just a quick way to reproduce my problem. The > real test use self.client, reverse, cast response.content to a string. > What I gave is a

Re: Testing if a view have an html element with at least one attribute

2016-07-31 Thread ludovic coues
Currently, I am using lxml. More dependencies but it's the cleanest method I've found currently. I use it like that: from django.test import TestCase from lxml import etree class FormTest(TestCase): def test_input(self): response =

jasig cas integration

2016-07-31 Thread Mahyar Damavand
Hi all, Is it possible to integrate django-cas client with a Jasig cas server or not If it is not what cas server should i use? I have to explain that a 403 forbidden error prevent authentication ending successfully. something like this not answered question: 403 Forbidden and jasig cas

Re: jasig cas integration

2016-07-31 Thread Martin Pépin
Hi, Jasig works perfectly fine with django-cas but the django-cas-ng module has to be prefered to it's old and no longer supported predecessor. Cheers ! Martin Pépin Le 31/07/2016 à 13:48, Mahyar Damavand a écrit : > Hi all, > Is it possible to integrate django-cas client with a Jasig cas

Re: Testing if a view have an html element with at least one attribute

2016-07-31 Thread Andreas Kuhne
Jupp, thats about what I meant :-) Probably the best way, if you don't want to check text. Regards, Andréas 2016-07-31 18:01 GMT+02:00 ludovic coues : > Currently, I am using lxml. More dependencies but it's the cleanest > method I've found currently. > I use it like that: >