Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing treemenus in a project #2

Open
feuervogel opened this issue Nov 2, 2010 · 6 comments
Open

testing treemenus in a project #2

feuervogel opened this issue Nov 2, 2010 · 6 comments

Comments

@feuervogel
Copy link

hi,

I'm using the github-version of treemenus in my django project and want to run the tests in context of the project. to make it short: it doesn't work. long story:

1st. not having added "treemenus.tests.fake_menu_extension", to the installed_apps I get:

Error: Database test_bb couldn't be flushed. Possible reasons:

  • The database isn't running or isn't configured correctly.
    • At least one of the expected database tables doesn't exist.
    • The SQL was invalid.
      Hint: Look at the output of 'django-admin.py sqlflush'. That's the SQL this command
      wasn't able to run.
      The full error: (1146, "Table 'test_bb.fake_menu_extension_fakemenuitemextension'
      doesn't exist")

twice. so I actually add "treemenus.tests.fake_menu_extension", to my installed apps, which leads to the 2nd situation:

2nd. I'm using custom templates using the url-tag referring to some urls of my project. the problem is, obviously you are using your own testing-urls and you are modifying the settings at runtime. so my tests don't pass but give me errors like:

TemplateSyntaxError: Caught NoReverseMatch while rendering:
Reverse for 'home' with arguments '()' and keyword arguments '{}' not found.

solution: please use the setup's test_suite option, as seen in http://github.com/alex/django-taggit/blob/master/setup.py for example.

@jphalip
Copy link
Owner

jphalip commented Nov 9, 2010

Thanks for reporting this issue and posting a fix. May I ask which database you're using (postgres, sqlite, etc.) when those test fail?

@feuervogel
Copy link
Author

i'm using sqlite for testing.

@jphalip
Copy link
Owner

jphalip commented Nov 16, 2010

I'm afraid I can't reproduce the issues you're reporting here. I've tried with sqlite and all tests pass...

@artscoop
Copy link
Contributor

Same problem, using Django 1.3.1 and PostgreSQL (Psycopg 2.4.1 since 2.4.2 is broken with Django 1.3.x)

@ramonrxven
Copy link

hi, in django 1.6 treemenus work fine, but i'm upgrade to django 1.8 and had this error:
Django Version: 1.8
Exception Type: ImportError
Exception Value:

cannot import name TOKEN_BLOCK
Exception Location: /local/lib/python2.7/site-packages/treemenus/templatetags/tree_menu_tags.py in render, line 63

regards

@jphalip
Copy link
Owner

jphalip commented May 1, 2015

@ramonrxven I suppose this is a separate issue. Could you create a separate ticket?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants