summaryrefslogtreecommitdiffstats
path: root/tests/test_pages.py
diff options
context:
space:
mode:
authorLauréline Guérin <zebuline@entrouvert.com>2019-10-14 12:05:26 (GMT)
committerLauréline Guérin <zebuline@entrouvert.com>2019-10-29 07:35:53 (GMT)
commita7417488eb63c32caf8a1a512ac3db879b656e93 (patch)
treee6704ce4063970be8d4a6a9211ee8ead7e21d2c5 /tests/test_pages.py
parentccf99d908f3263e7d249738664318b6d8648bea0 (diff)
downloadcombo-a7417488eb63c32caf8a1a512ac3db879b656e93.zip
combo-a7417488eb63c32caf8a1a512ac3db879b656e93.tar.gz
combo-a7417488eb63c32caf8a1a512ac3db879b656e93.tar.bz2
dj2: use set and/or clear method for M2M (#36895)
remove RemovedInDjango20Warning: Direct assignment to the forward side of a many-to-many set is deprecated due to the implicit save() that happens. Use items.set() instead.
Diffstat (limited to 'tests/test_pages.py')
-rw-r--r--tests/test_pages.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_pages.py b/tests/test_pages.py
index 158aba3..b27db89 100644
--- a/tests/test_pages.py
+++ b/tests/test_pages.py
@@ -112,14 +112,14 @@ def test_page_visibility():
group.save()
user1 = User(username='foo')
user1.save()
- user1.groups = [group]
+ user1.groups.set([group])
user2 = User(username='bar')
user2.save()
assert page.is_visible(user1)
assert page.is_visible(user2)
- page.groups = [group]
+ page.groups.set([group])
assert not page.is_visible()
assert page.is_visible(user1)
assert not page.is_visible(user2)