First time poster here,

I'm currently working on some unit tests of my Django app, and I'm running into 
a issue with is_authenticated.

I'm using Django 1.11.16 and Django CMS 3.5.2.

While trying to work with Django CMS menus, I get:

  File "/usr/local/lib/python3.6/site-packages/menus/menu_pool.py", line 243, 
in get_renderer
    return MenuRenderer(pool=self, request=request)
  File "/usr/local/lib/python3.6/site-packages/menus/menu_pool.py", line 107,  
in __init__
    self.draft_mode_active = use_draft(request)
  File "/usr/local/lib/python3.6/site-packages/cms/utils/moderator.py", line 5, 
in use_draft
    is_staff = (request.user.is_authenticated() and request.user.is_staff)
TypeError: 'property' object is not callable

Looking at the documentation, this should be fine. 
https://docs.djangoproject.com/en/1.11/ref/contrib/auth/#attributes

Trying this in a shell:
./run.sh manage shell
Python 3.6.6 (default, Sep 12 2018, 02:15:29) 
[GCC 6.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.contrib.auth.models import AnonymousUser
>>> AnonymousUser.is_authenticated
<property object at 0x7fb8c93878b8>
>>> bool(AnonymousUser.is_authenticated)
True
>>> AnonymousUser.is_authenticated()
Traceback (most recent call last):
  File "<console>", line 1, in <module>
TypeError: 'property' object is not callable

None of that seems right. Have I somehow managed to get something else pulled 
in?

In the actual application, not-logged in users see the right stuff, so 
apparently there it's working.


Stefan

-- 
Stefan Bethke <s...@lassitu.de>   Fon +49 151 14070811

-- 
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/E0552D52-C644-43AD-8F57-0DEAEC757445%40lassitu.de.
For more options, visit https://groups.google.com/d/optout.

Reply via email to