Anonymous
Does it work?
Anonymous
Or it's a Guess?
Sehrob
I do not know if it works, but according to the docs while getting the value from the database and converting it to python, models DateField uses this input_formats as a format paramter to the datetime modules strptime function.
inchidi
yeah passing input_formats value to DateTimeField should be enough
inchidi
Anonymous
Browser
inchidi
Anonymous
then yes
But as I said I already do that
inchidi
can you share your views?
Anonymous
Anonymous
When I reach home.
Sehrob
ok, think that must be enaugh
Anonymous
Hope so
Anonymous
One problem with django is, a lot of it's stuff is still not documented
Anonymous
And a lot of stuff is not documented at right place
Abhi
is have written this code for my custom error pages
Abhi
def my_custom_error_view(request):
return HttpResponseServerError(request, 'error/HTTP500.html', {})
Abhi
getting this error
Abhi
raise TypeError('HTTP status code must be an integer.')
TypeError: HTTP status code must be an integer.
Anonymous
Correct me if I'm wrong
Anonymous
But aren't you trying to use a http response object
Anonymous
And putting render shortcut arguments in it?
Abhi
but this method HttpResponseServerError automatically give response code 500
Anonymous
Maybe you override it when you passed the arguments
Abhi
nope
Anonymous
Lemme check it's docs
Anonymous
You did
Anonymous
You passed wrong arguments all along
Abhi
any idea how to run test cases with DEBUG=True in django
inchidi
https://docs.djangoproject.com/en/1.11/topics/testing/tools/#django.test.override_settings
Abhi
not working
Anonymous
Can I login for a whole test class in django
inchidi
Abhi
i don't know
Abhi
i am trying to test my custom error function that will render error pages
Abhi
aah
Abhi
it's very complex
Abhi
i will ask on stackoverflow and post the question here
inchidi
okay
Anonymous
inchidi
Anonymous
Well, that will work in each test case
Anonymous
Only*
Anonymous
The django login I got already does that anyway
Anonymous
Anyway, how can test if a HTML code exists in the response?
Anonymous
I am trying to use assertContains(...,html=True)
Anonymous
But, it gives me error
Charly
it should work, maybe you have another error
Anonymous
AssertionError : Couldn't find "the whole HTML code I passed"
Charly
I mean, in your test
Anonymous
Charly
Django's code is well tested, so ther are chances that you wrote bad code or bad tests
Anonymous
LOL
Anonymous
Well,I have my HTML code running in my browser
Anonymous
And I'm just copying and pasting it
Charly
dude, paste you code here
Anonymous
Charly
we cant just try to guess
Charly
more code
Charly
are you using request factory? are you testing a view? are yout esting a templatetag? are you testing a plain function? are you testing a template processor?
Anonymous
I am testing a view
Anonymous
Which renders a template perfectly fine
Anonymous
But, assertion fails
Charly
PUT YOUR CODEEEEEEE
Lapanit ☃️
in pastebin
Anonymous
Can't
Charly
Django Bot
>> Blogs
- Renaming Django's Auth User and App
Anonymous
WTF
Anonymous
Sup
Anonymous
Is there any bottle group?
Group Butler
Sinatra now is a moderator
JZA
Good
Anonymous
Abhi
https://stackoverflow.com/questions/45896954/how-to-run-tests-with-debug-true-in-django
Anonymous
Anonymous
That format is used to render date field in a particular format