Codebase list djangorestframework-gis / 47e049e
Import djangorestframework-gis_0.11.2.orig.tar.gz Michael Fladischer 6 years ago
11 changed file(s) with 67 addition(s) and 20 deletion(s). Raw diff Collapse all Expand all
00 Changelog
11 =========
2
3 Version 0.11.2 [2017-05-22]
4 ---------------------------
5
6 - `eb54fc0 <https://github.com/djangonauts/django-rest-framework-gis/commit/eb54fc0>`_: ``GeometryFilter`` now use ``BaseGeometryWidget``
7 - `33a6418 <https://github.com/djangonauts/django-rest-framework-gis/commit/33a6418>`_: fixed tests for Django 1.11: ``Point`` comparison uses ``srid``
28
39 Version 0.11.1 [2017-05-05]
410 ---------------------------
00 Metadata-Version: 1.1
11 Name: djangorestframework-gis
2 Version: 0.11.1
2 Version: 0.11.2
33 Summary: Geographic add-ons for Django Rest Framework
44 Home-page: https://github.com/djangonauts/django-rest-framework-gis
55 Author: Douglas Meehan
3838
3939 =============== ============================ ==================== ==================================
4040 DRF-gis version DRF version Django version Python version
41 **0.11.x** **3.1** to **3.6** **1.7** to **1.10** **2.7** to **3.5**
41 **0.11.x** **3.1** to **3.6** **1.7** to **1.11** **2.7** to **3.6**
4242 **0.10.x** **3.1** to **3.3** **1.7** to **1.9** **2.7** to **3.5**
4343 **0.9.6** **3.1** to **3.2** **1.5** to **1.8** **2.6** to **3.5**
4444 **0.9.5** **3.1** to **3.2** **1.5** to **1.8** **2.6** to **3.4**
573573 Running the tests
574574 -----------------
575575
576 Assuming one has the dependencies installed (restframework and
577 restframework\_gis), and one of the `Spatial Database server supported
578 by
579 GeoDjango <https://docs.djangoproject.com/en/dev/ref/contrib/gis/db-api/#module-django.contrib.gis.db.backends>`__
580 is up and running:
576 Required setup
577 ==============
578
579 You need one of the `Spatial Database servers supported by
580 GeoDjango <https://docs.djangoproject.com/en/dev/ref/contrib/gis/db-api/#module-django.contrib.gis.db.backends>`__,
581 and create a database for the tests.
582
583 The following can be used with PostgreSQL:
581584
582585 .. code-block:: bash
583586
584 ./runtests.py
587 createdb django_restframework_gis
588 psql -U postgres -d django_restframework_gis -c "CREATE EXTENSION postgis"
585589
586590 You might need to tweak the DB settings according to your DB
587591 configuration. You can copy the file ``local_settings.example.py`` to
588592 ``local_settings.py`` and change the ``DATABASES`` and/or
589593 ``INSTALLED_APPS`` directives there.
590594
591 If you want to contribute you need to install the test app in a proper
592 development environment.
593
594 These steps should do the trick:
595 This should allow you to run the tests already.
596
597 For reference, the following steps will setup a development environment for
598 contributing to the project:
595599
596600 - create a spatial database named "django\_restframework\_gis"
597601 - create ``local_settings.py``, eg:
604608 - run ``python manage.py syncdb``
605609 - run ``python manage.py collectstatic``
606610 - run ``python manage.py runserver``
611
612 Using tox
613 =========
614
615 The recommended way to run the tests is by using
616 `tox <https://tox.readthedocs.io/en/latest/>`__, which can be installed using
617 `pip install tox`.
618
619 You can use ``tox -l`` to list the available environments, and then e.g. use
620 the following to run all tests with Python 3.6 and Django 1.11:
621
622 .. code-block:: bash
623
624 tox -e py36-django111
625
626 By default Django's test runner is used, but there is a variation of tox's
627 envlist to use pytest (using the ``-pytest`` suffix).
628
629 You can pass optional arguments to the test runner like this:
630
631 .. code-block:: bash
632
633 tox -e py36-django111-pytest -- -k test_foo
634
635 Running tests manually
636 ======================
637
638 Please refer to the ``tox.ini`` file for reference/help in case you want to run
639 tests manually / without tox.
607640
608641 Contributing
609642 ------------
00 Metadata-Version: 1.1
11 Name: djangorestframework-gis
2 Version: 0.11.1
2 Version: 0.11.2
33 Summary: Geographic add-ons for Django Rest Framework
44 Home-page: https://github.com/djangonauts/django-rest-framework-gis
55 Author: Douglas Meehan
1919 rest_framework_gis/pagination.py
2020 rest_framework_gis/serializers.py
2121 rest_framework_gis/tilenames.py
22 tests/__init__.py
2322 tests/local_settings.example.py
2423 tests/local_settings.py
2524 tests/manage.py
0 VERSION = (0, 11, 1, 'final')
0 VERSION = (0, 11, 2, 'final')
11 __version__ = VERSION # alias
22
33
7373
7474 class GeometryFilter(django_filters.Filter):
7575 field_class = forms.GeometryField
76
77 def __init__(self, *args, **kwargs):
78 kwargs.setdefault('widget', forms.BaseGeometryWidget)
79 super(GeometryFilter, self).__init__(*args, **kwargs)
7680
7781
7882 class GeoFilterSet(django_filters.FilterSet):
22
33 [egg_info]
44 tag_build =
5 tag_svn_revision = 0
56 tag_date = 0
67
2121 if sys.argv[-1] == 'publish':
2222 os.system("python setup.py sdist bdist_wheel")
2323 os.system("twine upload -s dist/*")
24 os.system("rm -rf dist")
24 os.system("rm -rf dist build")
2525 args = {'version': get_version()}
2626 print("You probably want to also tag the version now:")
2727 print(" git tag -a %(version)s -m 'version %(version)s'" % args)
+0
-0
tests/__init__.py less more
(Empty file)
486486 self.assertEqual(response.status_code, 200)
487487 location_reloaded = Location.objects.get(pk=location.id)
488488 self.assertEquals(location_reloaded.name, 'geojson successful patch test')
489 self.assertEquals(location_reloaded.geometry, Point(10.1, 10.1))
489 self.assertEquals(location_reloaded.geometry,
490 Point(10.1, 10.1, srid=location.geometry.srid))
490491
491492 def test_patch_geojson_location_wo_changing_geometry(self):
492493 location = Location.objects.create(name='geojson patch test', geometry='POINT (135.0 45.0)')
500501 self.assertEqual(response.status_code, 200)
501502 location_reloaded = Location.objects.get(pk=location.id)
502503 self.assertEquals(location_reloaded.name, 'geojson successful patch test')
503 self.assertEquals(location_reloaded.geometry, Point(135.0, 45.0))
504 self.assertEquals(location_reloaded.geometry,
505 Point(135.0, 45.0, srid=location.geometry.srid))
504506
505507 def test_geometry_serializer_method_field(self):
506508 location = Location.objects.create(name='geometry serializer method test', geometry='POINT (135.0 45.0)')
507509 location_loaded = Location.objects.get(pk=location.id)
508510 self.assertEqual(location_loaded.name, 'geometry serializer method test')
509 self.assertEqual(location_loaded.geometry, Point(135.0, 45.0))
511 self.assertEqual(location_loaded.geometry,
512 Point(135.0, 45.0, srid=location.geometry.srid))
510513 url = reverse('api_geojson_location_details_hidden', args=[location.id])
511514 data = {
512515 "properties": {
522525 def test_geometry_serializer_method_field_none(self):
523526 location = Location.objects.create(name='None value', geometry='POINT (135.0 45.0)')
524527 location_loaded = Location.objects.get(pk=location.id)
525 self.assertEqual(location_loaded.geometry, Point(135.0, 45.0))
528 self.assertEqual(location_loaded.geometry,
529 Point(135.0, 45.0, srid=location.geometry.srid))
526530 url = reverse('api_geojson_location_details_none', args=[location.id])
527531 response = self.client.generic('GET', url, content_type='application/json')
528532 self.assertEqual(response.status_code, 200)