diff --git a/AUTHORS b/AUTHORS
index b64a627..689b2d1 100644
a
|
b
|
answer newbie questions, and generally made Django that much better:
|
550 | 550 | Gasper Zejn <zejn@kiberpipa.org> |
551 | 551 | Jarek Zgoda <jarek.zgoda@gmail.com> |
552 | 552 | Cheng Zhang |
| 553 | Dougal Matthews <dougal@dougalmatthews.com> |
553 | 554 | |
554 | 555 | A big THANK YOU goes to: |
555 | 556 | |
diff --git a/django/dispatch/dispatcher.py b/django/dispatch/dispatcher.py
index ed9da57..857b06f 100644
a
|
b
|
class Signal(object):
|
253 | 253 | finally: |
254 | 254 | self.lock.release() |
255 | 255 | |
| 256 | def __reduce__(self): |
| 257 | """ |
| 258 | Return a 2-tuple containing a callable and the arguements for the |
| 259 | callable which can be used by pickle to pickle and unpickle Signal |
| 260 | instances. |
| 261 | """ |
| 262 | return (Signal, (self.providing_args,)) |
| 263 | |
256 | 264 | |
257 | 265 | def receiver(signal, **kwargs): |
258 | 266 | """ |
diff --git a/tests/regressiontests/signals_regress/tests.py b/tests/regressiontests/signals_regress/tests.py
index 332f5d9..90917d7 100644
a
|
b
|
class SignalsRegressTests(TestCase):
|
92 | 92 | self.get_signal_output(a1.save) |
93 | 93 | self.assertEqual(self.get_signal_output(setattr, b1, 'authors', [a1]), []) |
94 | 94 | self.assertEqual(self.get_signal_output(setattr, b1, 'authors', []), []) |
| 95 | |
| 96 | def test_pickle_signal(self): |
| 97 | """ Test that a Signal instance can be pickled.""" |
| 98 | |
| 99 | import pickle |
| 100 | pickled_string = """cdjango.dispatch.dispatcher\nSignal\np0\n(c__builtin__ |
| 101 | set\np1\n((lp2\nS'instance'\np3\naS'using'\np4\naS'raw'\np5\natp6\nRp7\ntp8\nRp9\n.""" |
| 102 | |
| 103 | result = pickle.dumps(models.signals.pre_save) |
| 104 | self.assertEqual(pickled_string, result) |