Permalink
Browse files

Moved testsuite position.

  • Loading branch information...
1 parent b47f327 commit e90a3c3e34163a2f682b4787feaf2fd145ea891b @ikeikeikeike committed Jul 15, 2012
Showing with 12 additions and 202 deletions.
  1. +5 −1 HISTORY.rst
  2. +1 −1 MANIFEST.in
  3. +2 −2 docs/source/conf.py
  4. +2 −1 queryset_client/__init__.py
  5. 0 { → queryset_client}/tests/__init__.py
  6. 0 { → queryset_client}/tests/base/__init__.py
  7. 0 { → queryset_client}/tests/base/fixtures/base_data.json
  8. 0 { → queryset_client}/tests/base/fixtures/small_data.json
  9. 0 { → queryset_client}/tests/base/forms.py
  10. 0 { → queryset_client}/tests/base/models.py
  11. 0 { → queryset_client}/tests/base/tests/__init__.py
  12. 0 { → queryset_client}/tests/base/tests/count.py
  13. 0 { → queryset_client}/tests/base/tests/create.py
  14. 0 { → queryset_client}/tests/base/tests/exists.py
  15. 0 { → queryset_client}/tests/base/tests/foreignkey.py
  16. 0 { → queryset_client}/tests/base/tests/get_or_create.py
  17. 0 { → queryset_client}/tests/base/tests/latest.py
  18. 0 { → queryset_client}/tests/base/tests/lazy.py
  19. 0 { → queryset_client}/tests/base/tests/len.py
  20. 0 { → queryset_client}/tests/base/tests/many_to_many.py
  21. 0 { → queryset_client}/tests/base/tests/model.py
  22. 0 { → queryset_client}/tests/base/tests/order_by.py
  23. 0 { → queryset_client}/tests/base/tests/paginator.py
  24. 0 { → queryset_client}/tests/base/tests/slice.py
  25. 0 { → queryset_client}/tests/base/tests/strict.py
  26. 0 { → queryset_client}/tests/base/tests/utils.py
  27. 0 { → queryset_client}/tests/settings.py
  28. 0 { → queryset_client}/tests/settings_base.py
  29. 0 { → queryset_client}/tests/testcases.py
  30. +1 −26 setup.py
  31. 0 tests/base/api/__init__.py
  32. +0 −16 tests/base/api/auth.py
  33. +0 −138 tests/base/api/resources.py
  34. +0 −16 tests/base/api/urls.py
  35. +1 −1 tox.ini
View
@@ -7,4 +7,8 @@ History
0.6.2 (2012-07-15)
~~~~~~~~~~~~~~~~~~~
* Fixed issue #31 (Pagination Performance)
-* Support strict field in Model.
+* Support strict field in Model.
+
+0.6.3 (2012-07-15)
+~~~~~~~~~~~~~~~~~~~
+* Moved testsuite position.
View
@@ -4,4 +4,4 @@ include README.rst
include README.md
include HISTORY.rst
recursive-include tests *
-recursive-include docs *
+recursive-include docs *
View
@@ -51,9 +51,9 @@
# built documents.
#
# The short X.Y version.
-version = '0.6.2'
+version = '0.6.3'
# The full version, including alpha/beta/rc tags.
-release = '0.6.2'
+release = '0.6.3'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -1,6 +1,7 @@
from client import Client
-VERSION = (0, 6, 2, 'rc', 1)
+VERSION = (0, 6, 3, 'final', 1)
+
def get_version(version=None):
"""
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
@@ -2,43 +2,18 @@
from setuptools import setup, find_packages
# from setuptools.command.test import test
-version = '0.6.2'
+version = '0.6.3'
name = 'tastypie-queryset-client'
short_description = 'Client for Tastypie. Provide operation similar to the Django Model API'
long_description = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
-def fullsplit(path, result=None):
- """
- Split a pathname into components (the opposite of os.path.join) in a
- platform-neutral way.
- """
- if result is None:
- result = []
- head, tail = os.path.split(path)
- if head == '':
- return [tail] + result
- if head == path:
- return result
- return fullsplit(head, [tail] + result)
-
-
packages, data_files = [], []
root_dir = os.path.dirname(__file__)
if root_dir != '':
os.chdir(root_dir)
extensions_dir = 'queryset_client'
-for dirpath, dirnames, filenames in os.walk(extensions_dir):
- # Ignore dirnames that start with '.'
- for i, dirname in enumerate(dirnames):
- if dirname.startswith('.'):
- del dirnames[i]
- if '__init__.py' in filenames:
- packages.append('.'.join(fullsplit(dirpath)))
- elif filenames:
- data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]])
-
setup(
name=name,
No changes.
View
@@ -1,16 +0,0 @@
-from tastypie.authorization import Authorization
-from tastypie.authentication import Authentication
-
-class ThroughAuthentication(Authentication):
-
- def is_authenticated(self, request, **kwargs):
- return True
-
- def get_identifier(self, request):
- return 1
-
-
-class ThroughAuthorization(Authorization):
-
- def is_authorized(self, request, object=None):
- return True
View
@@ -1,138 +0,0 @@
-# external library
-from django.conf.urls import url
-from django.core.paginator import Paginator
-from tastypie import fields
-from tastypie.resources import (
- # Resource,
- ModelResource,
- ALL,
- ALL_WITH_RELATIONS
-)
-from tastypie.utils.urls import trailing_slash
-from .auth import (
- ThroughAuthentication,
- ThroughAuthorization
-)
-
-# applications
-from .. import models as mdl
-
-
-class InboxResource(ModelResource):
- """ Inbox Model Resource """
-
- class Meta:
- queryset = mdl.Inbox.objects.all()
- resource_name = 'inbox'
- filtering = {
- # allow attributes
- "id": ALL,
- "did": ALL
- }
- authentication = ThroughAuthentication()
- authorization = ThroughAuthorization()
-
-
-class MessageResource(ModelResource):
- """ Message Model Resource """
-
- class Meta:
- queryset = mdl.Message.objects.all()
- resource_name = 'message'
- filtering = {
- # allow attributes
- "id": ALL,
- "subject": ALL,
- "body": ALL
- }
- ordering = (
- "id",
- "body",
- )
- authentication = ThroughAuthentication()
- authorization = ThroughAuthorization()
-
-
- def prepend_urls(self):
- """ dispatcher """
- return [
- url(r"^(?P<resource_name>{0})/paginator{1}$".format(
- self._meta.resource_name, trailing_slash()),
- self.wrap_view('paginator'), name="apimethod-message-paginator"),
- ]
-
- def paginator(self, request, **kwargs):
- """ """
- message = mdl.Message.objects.all()
-
-# mes = message[0:100]
-# print type(mes)
-#
-# try:
-# for i in message:
-# print i
-# except Exception:
-# pass
-#
-# try:
-# print message.count()
-# except Exception:
-# pass
-
- p = Paginator(message, 100)
-
- page = p.page(3)
- try:
- num = 0
- for num, i in page:
- pass
- except Exception:
- pass
-
- page = p.page(1)
- try:
- num = 0
- for num, i in enumerate(page):
- pass
- except Exception:
- pass
-
- return {}
-
-
-class InboxMessageResource(ModelResource):
- """ Inbox Model Resource """
-
- inbox = fields.ForeignKey(InboxResource, "inbox")
- message = fields.ForeignKey(MessageResource, "message")
-
- class Meta:
- resource_name = 'inbox_message'
- queryset = mdl.InboxMessage.objects.all()
- filtering = {
- # allow attributes
- "id": ALL,
- "inbox": ALL_WITH_RELATIONS,
- "message": ALL_WITH_RELATIONS
- }
- authentication = ThroughAuthentication()
- authorization = ThroughAuthorization()
-
-
-
-class InboxMessageManyResource(ModelResource):
- """ """
-
- inbox_message = fields.ManyToManyField(InboxMessageResource, "inbox_message")
-
- class Meta:
- resource_name = "inbox_message_many"
- queryset = mdl.InboxMessageMany.objects.all()
- filtering = {
- # allow attributes
- "id": ALL,
- "inbox_message": ALL_WITH_RELATIONS,
- }
- authentication = ThroughAuthentication()
- authorization = ThroughAuthorization()
-
View
@@ -1,16 +0,0 @@
-from django.conf.urls.defaults import (
- patterns,
- include
-)
-from tastypie.api import Api
-from .resources import *
-
-api = Api(api_name="v1")
-api.register(InboxResource())
-api.register(MessageResource())
-api.register(InboxMessageResource())
-api.register(InboxMessageManyResource())
-
-urlpatterns = patterns('',
- (r'^base/', include(api.urls)),
-)
View
@@ -12,7 +12,7 @@ envlist =
[testenv]
setenv =
- PYTHONPATH = {toxinidir}/tests:{toxinidir}
+ PYTHONPATH = {toxinidir}/queryset_client/tests:{toxinidir}/queryset_client
deps =
pytest
django

0 comments on commit e90a3c3

Please sign in to comment.