char0n / django-pybrowscap

pybrowscap middlware for django
http://www.codescale.net/en/community/#django-pybrowscap
Other
4 stars 0 forks source link

Tests failing, needs models.py to be recognized as app #2

Closed chronossc closed 12 years ago

chronossc commented 12 years ago

Hello, you need the models.py on package to be recognized as app by django. Also, tryed basic setup and tests are failing:

(patricio_projects)felipe@felipe-G51JX:~/projects/patricio_projects/neox$ m test django_pybrowscap
Traceback (most recent call last):
  File "./manage.py", line 11, in <module>
    execute_manager(settings)
  File "/home/felipe/projects/patricio_projects/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/home/felipe/projects/patricio_projects/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/felipe/projects/patricio_projects/local/lib/python2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/felipe/projects/patricio_projects/local/lib/python2.7/site-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/home/felipe/projects/patricio_projects/local/lib/python2.7/site-packages/django/core/management/commands/test.py", line 37, in handle
    failures = test_runner.run_tests(test_labels)
  File "/home/felipe/projects/patricio_projects/local/lib/python2.7/site-packages/django/test/simple.py", line 395, in run_tests
    suite = self.build_suite(test_labels, extra_tests)
  File "/home/felipe/projects/patricio_projects/local/lib/python2.7/site-packages/django/test/simple.py", line 285, in build_suite
    app = get_app(label)
  File "/home/felipe/projects/patricio_projects/local/lib/python2.7/site-packages/django/db/models/loading.py", line 140, in get_app
    raise ImproperlyConfigured("App with label %s could not be found" % app_label)
django.core.exceptions.ImproperlyConfigured: App with label django_pybrowscap could not be found

(patricio_projects)felipe@felipe-G51JX:~/projects/patricio_projects/neox$ touch ../lib/python2.7/site-packages/django_pybrowscap/models.py

(patricio_projects)felipe@felipe-G51JX:~/projects/patricio_projects/neox$ m test django_pybrowscap
Creating test database 'default'...
Creating table admin_tools_menu_bookmark
Creating table admin_tools_dashboard_preferences
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table auth_message
Creating table django_content_type
Creating table django_session
Creating table django_admin_log
Creating table django_site
Creating table cms_placeholder
Creating table cms_cmsplugin
Creating table cms_page_placeholders
Creating table cms_page
Creating table cms_pagemoderator
Creating table cms_pagemoderatorstate
Creating table cms_globalpagepermission_sites
Creating table cms_globalpagepermission
Creating table cms_pagepermission
Creating table cms_pageuser
Creating table cms_pageusergroup
Creating table cms_title
Creating table cmsplugin_text
Creating table cmsplugin_teaser
Creating table cmsplugin_flash
Creating table cmsplugin_picture
Creating table cmsplugin_link
Creating table cmsplugin_file
Creating table snippet_snippet
Creating table cmsplugin_snippetptr
Creating table cmsplugin_googlemap
Creating table menus_cachekey
Creating table cmsplugin_flickrplugin
Creating table django_flickr_flickrupload
Creating table cmsplugin_simpletext
Creating table contact_contact
Installing index for menu.Bookmark model
Installing index for dashboard.DashboardPreferences model
Installing index for auth.Permission model
Installing index for auth.Group_permissions model
Installing index for auth.User_user_permissions model
Installing index for auth.User_groups model
Installing index for auth.Message model
Installing index for admin.LogEntry model
Installing index for cms.Placeholder model
Installing index for cms.CMSPlugin model
Installing index for cms.Page_placeholders model
Installing index for cms.Page model
Installing index for cms.PageModerator model
Installing index for cms.PageModeratorState model
Installing index for cms.GlobalPagePermission_sites model
Installing index for cms.GlobalPagePermission model
Installing index for cms.PagePermission model
Installing index for cms.PageUser model
Installing index for cms.PageUserGroup model
Installing index for cms.Title model
Installing index for teaser.Teaser model
Installing index for picture.Picture model
Installing index for link.Link model
Installing index for snippet.SnippetPtr model
No fixtures found.
No handlers could be found for logger "pybrowscap.loader.csv"
.F..F...EEE
======================================================================
ERROR: test_no_update (django_pybrowscap.tests.test_middleware.TestUpdate)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/felipe/projects/patricio_projects/local/lib/python2.7/site-packages/django_pybrowscap/tests/test_middleware.py", line 89, in test_no_update
    self.assertGreaterEqual(datetime.now(), instance.browscap.loaded_at)
AttributeError: 'NoneType' object has no attribute 'loaded_at'

======================================================================
ERROR: test_update (django_pybrowscap.tests.test_middleware.TestUpdate)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/felipe/projects/patricio_projects/local/lib/python2.7/site-packages/django_pybrowscap/tests/test_middleware.py", line 67, in test_update
    self.assertGreaterEqual(datetime.now(), instance.browscap.loaded_at)
AttributeError: 'NoneType' object has no attribute 'loaded_at'

======================================================================
ERROR: test_update_long_interval (django_pybrowscap.tests.test_middleware.TestUpdate)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/felipe/projects/patricio_projects/local/lib/python2.7/site-packages/django_pybrowscap/tests/test_middleware.py", line 78, in test_update_long_interval
    self.assertGreaterEqual(datetime.now(), instance.browscap.loaded_at)
AttributeError: 'NoneType' object has no attribute 'loaded_at'

======================================================================
FAIL: test_ignore_nothing (django_pybrowscap.tests.test_middleware.TestIgnorePaths)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/felipe/projects/patricio_projects/local/lib/python2.7/site-packages/django_pybrowscap/tests/test_middleware.py", line 102, in test_ignore_nothing
    self.assertIsNotNone(self.request.browser)
AssertionError: unexpectedly None

======================================================================
FAIL: test_initialization_on (django_pybrowscap.tests.test_middleware.TestInitialize)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/felipe/projects/patricio_projects/local/lib/python2.7/site-packages/django_pybrowscap/tests/test_middleware.py", line 45, in test_initialization_on
    self.assertIsNotNone(self.request.browser)
AssertionError: unexpectedly None

----------------------------------------------------------------------
Ran 11 tests in 0.005s

FAILED (failures=2, errors=3)
Destroying test database 'default'...
(patricio_projects)felipe@felipe-G51JX:~/projects/patricio_projects/neox$ 
char0n commented 12 years ago

Thanks for reporting, issue is fixed. I have already relesed these fixes as version 0.9.1 on pypi.