Commit Graph

363 Commits

Author SHA1 Message Date
Artem Malyshev
672de2b2a3 Separate tests into own directory. (#531)
* Move project tests to its own directory.

* Install mock test dependency for Python2 only.

* Do not install tox inside tox environment.

* Exclude tests from sdist.

* Use recent pip on Travis-CI.
2017-02-16 10:22:23 -08:00
Pierre Chiquet
95c9925fe4 Update Binding to support models with UUIDField as primary key (#528)
* Add custom TestUUIDModel for auto tests

* Update Binding to support models with UUIDField as primary key

Add and fix test_trigger_outbound_create_non_auto_pk.
Before updating pre_save_receiver, this new test failed with this error:

======================================================================
FAIL: test_trigger_outbound_create_non_auto_pk
(channels.tests.test_binding.TestsBinding)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\User\git\contribs\python\channels\channels\tests\test_binding.py", line 85, in test_trigger_outbound_create_non_auto_pk
    self.assertEqual(received['payload']['action'], 'create')
AssertionError: u'update' != u'create'
2017-02-14 09:48:00 -08:00
Matthias K
b14bbeebe4 Fix two typos (#521) 2017-02-07 10:20:06 -08:00
Andrew Godwin
20af4e31b4 Releasing 1.0.3 2017-02-01 12:03:57 -08:00
Andrew Godwin
558d66a6b2 Fixed #512: Give rundelay a configurable sleep interval
Also reduced the default interval to 1s.
2017-01-30 17:13:30 -08:00
Andrew Godwin
57ed7747f7 Handle slight ordering not being set 2017-01-26 10:47:54 -08:00
Andrew Godwin
a1a1ace23d Remove slight ordering from generics docs 2017-01-26 10:44:08 -08:00
Andrew Godwin
1a56ae8eb7 Sort imports correctly. 2017-01-25 17:04:06 -08:00
Andrew Godwin
9ae27cb835 Fixed #462: Don't actually close DB connections during tests 2017-01-25 16:59:35 -08:00
Andrew Godwin
db8a4570c3 Fixed #477: Only re-save session if it's not empty 2017-01-24 09:57:38 -08:00
Joseph Ryan
1e2cd8ec76 Fix for session shenanigans with WebsocketDemultiplexer (#486)
* Fix for session shenanigans with WebsocketDemultiplexer

Session data was getting lost in the demux due to the session getting
saved after only the first connect/disconnect consumer was run.

* fix for flake8

* flake8 again

flake8 again
2017-01-17 16:20:08 -08:00
Andrew Godwin
fd30bff5de Fixed #483: HttpResponse takes "status", not "status_code" 2017-01-13 09:32:41 -08:00
Andrew Godwin
811d017dc9 Releasing 1.0.2 2017-01-12 10:12:09 -08:00
Andrew Godwin
05b5fa5216 Fixed #482: Group_names not updated right in base classes. 2017-01-12 10:09:36 -08:00
Krukov D
37da462411 User friendly way to close websocket with code (via CloseException) (#468)
* User friendly way to close websocket with status

* More generic way  to close(whatever) connection by exception

* Fix import ordering for exceptions (isort)
2017-01-12 10:02:30 -08:00
Andrew Godwin
2ced4ee2e9 Remove consumer_finished from tests that flushed
No longer needed now messages aren't buffered outside consumers.
2017-01-11 15:40:24 -08:00
Andrew Godwin
69c59ee8b4 Fixed #481: Sends from outside consumers send immediately 2017-01-11 15:35:50 -08:00
Krukov D
b84713b20e Remove unicode literals (#476) 2017-01-11 10:03:03 -08:00
Andrew Godwin
2650505eab Releasing 1.0.1 2017-01-09 22:10:18 -08:00
Krukov D
8a93dfc401 Accept Connection at WebsocketConsumer (#467)
* Added accept at default behavior for websocket generic cbv and pass message instead of dict

* Fix flake8

* Use HttpClient Instead of Client

* Fix lsort
2017-01-09 10:08:00 -08:00
Andrew Godwin
827fcd25b1 Releasing 1.0.0 2017-01-08 18:37:03 -08:00
Andrew Godwin
c0ba284bbb Fix import ordering 2017-01-08 18:33:31 -08:00
Andrew Godwin
aa3af5031c Fix bad asserts in runserver endpoint tests 2017-01-08 18:18:00 -08:00
Andrew Godwin
8ed7a2d3a2 Remove unused imports 2017-01-08 18:11:44 -08:00
Sean Mc Allister
d9bff34428 build endpoint description strings from runserver arguments before ca… (#434)
* build endpoint description strings from runserver arguments before calling dpahne server

* Update Daphne requirement
2017-01-08 18:10:56 -08:00
Andrew Godwin
cba54f9749 Fix up new demultiplexer/databinding interactions 2017-01-08 18:05:51 -08:00
raphael.boucher
33dbc4a184 Replace multiplexer with class demultiplexer
Update documentation
Ensure send is not available on demultiplexed consumer classes
Data binding needs fixing
2017-01-08 18:05:50 -08:00
raphael.boucher
21b08b01b8 Add demultiplexer for class-based consumers (#383)
Avoid coupling between the demultiplexer and consumers.
2017-01-08 18:05:50 -08:00
Artem Skoretskiy
387c73fa27 Fixed import to resolve RemovedInDjango20Warning (#457)
* Fixed import to resolve RemovedInDjango20Warning

That resolves: "RemovedInDjango20Warning: Importing from django.core.urlresolvers is deprecated in favor of django.urls."

* Fixed syntax error

Fixed indent

* Updated import order
2017-01-02 08:14:34 -08:00
scryver
7230708f6f Update utils.py (#455)
Name that thing should not use a metaclass to name a thing.
2016-12-30 09:44:03 +00:00
Drew French
f4c9b02ae3 Valid cookie serialization for the test HTTPClient (#453)
* valid cookie serialization

* Added set cookie test

* delimiter fix

* more cases

* quote fix

* cleanup

* fix

* lint cleanup

* more lint clean up
2016-12-22 22:46:09 +00:00
AlexejStukov
cb0a9bef4b Use save's update_fields in serialize_data (#448)
* pass save's kwargs to serialize

So it can access update_fields

* added short explanation

* added missing kwargs

* use update_fields to filter fields to serialize

* save kwargs on self

* get signal_kwargs from self

* whitespace

* just save signal_kwargs on self+removed left over kwargs
2016-12-16 20:00:11 +00:00
Andrew Godwin
54705915de Make formatting in management tests consistent 2016-12-10 11:57:28 -08:00
Andrew Godwin
3d2426e7b4 Fix root_path in runserver tests 2016-12-10 11:55:49 -08:00
Andrew Godwin
5a38171fc7 Fix #449: root_path was ending up as None 2016-12-10 11:48:11 -08:00
Sam Bolgert
3dddefa845 Delay Protocol Server (#401)
* Add Delay Protocol Server

Add a process that listens to a specific channel
and delays incoming messages by a given time.

* Add custom django command rundelay
* Add test suite
* Implements #115

* Add channels.delay app

* Add AppConfig

* Move rundelay command to channels.delay app

* Refactor DelayedMessage into model

Move login into a database backed model.
* Update Worker
* Add migration

* Add delay docs page

* Add to TOC

* Fix import sorting

* Add ASGI spec document for Delay Protocol

* Update channels.delay doc with new channel name
* remove interval docs

* Refactor Delay to use milliseconds instead of seconds

Use milliseconds as the default unit. Gives more control to developers.

* Remove interval logic from DelayedMessage
* Remove interval tests
* Tweak test logic to use milliseconds
2016-11-24 10:54:03 -08:00
Jan Boysen
fdc80cb269 runserver should respect FORCE_SCRIPT_NAME setting (#435)
* Pass FORCE_SCRIPT_NAME to Daphne server when set

FORCE_SCRIPT_NAME seems not to be honored any more with build-in runserver after activating channels app.
The normal behavior of Django is the FORCE_SCRIPT_NAME is used as prefix when set while generating URLs so its possible to
create a path prefix and determine different Django installations based on the path rather than hostname without having to prefix all paths in urls.py.

* Only strip script_name from path if it starts with it

* make tests happy again after setting kwarg root_path
2016-11-18 06:26:16 -08:00
Tobias Kunze
82f7ff21df Add closing response codes (#426)
Added both to spec and implementation. Regards #414.
2016-11-05 13:39:44 +01:00
Paul
f4f45dbb9f Sort imports and make Travis run isort (#425)
* Sort imports

* Make Travis run isort
2016-11-05 12:08:38 +01:00
Andrew Godwin
c5f047a245 Fix test to look for SERVER_PORT 2016-11-02 08:17:44 +00:00
Andrew Godwin
6d8d3214e6 Fixed #422: No SERVER_PORT in request.META causes errors 2016-11-02 08:15:06 +00:00
Krukov D
e24bc17bbf Documentation of Client/HttpClient and data binding unit tests (#417)
* Added as_route documentation

* Added documentation for client

* Improve tests for binding

* Changes for client docs

* Fix docs indentations at client part

* Added missed imports

* Small fixes and refs

* Fix typos

* Fix errors and typos.
2016-10-31 11:42:10 +00:00
Yatish Bathini
291405afeb Issue#393: Clear session modified flag on enforce_ordering session save (#402) 2016-10-21 11:59:45 -07:00
AlexejStukov
4f517bb9fc check accept fields = '__all__' in serialize_data (#404) 2016-10-19 09:25:34 -07:00
MartinArroyo
12ca598d6b Adds 'exclude' option to data binding (#400) 2016-10-16 22:58:02 -07:00
Jeremy Spencer
51561273ae Fix for issue 398. Converts channels.binding.websockets.WebsocketBinding.fields to list before comparing to ['__all__'] to ensure most common data structures do not cause unexpected failures (i.e. ('__all__',), '__all__') (#399) 2016-10-14 18:54:46 -07:00
Luke Hodkinson
1673be5b75 Found a bug whereby streaming responses would try to be cached (#396)
entirely in memory. Was causing views that stream a lot of data
to timeout.
2016-10-11 22:32:45 -07:00
Rock Howard
c419d01ded added http_timeout as a command line option for runserver (#387)
* added http_timeout as a comand line option for runserver

* possible improvement for input param management

* explicitly set the default http_timeout in add_argument
2016-10-11 13:25:27 -07:00
Andrew Godwin
09b2a12be1 Change to accept being part of send/close 2016-10-05 15:59:55 -07:00
Andrew Godwin
f9ef08b0aa Flake8 fix 2016-10-05 15:37:55 -07:00