-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #173 from mozilla-services/remember-keyschangedat-…
…after-node-replacement; r=jrconlin fix: remember keys_changed_at when reallocating after node replacement.
- Loading branch information
Showing
2 changed files
with
8 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -197,12 +197,17 @@ def test_cleanup_of_old_records(self): | |
|
||
def test_node_reassignment_when_records_are_replaced(self): | ||
self.backend.allocate_user("sync-1.0", "[email protected]", | ||
generation=42, client_state="aaa") | ||
generation=42, | ||
keys_changed_at=12, | ||
client_state="aaa") | ||
user1 = self.backend.get_user("sync-1.0", "[email protected]") | ||
self.backend.replace_user_records("sync-1.0", "[email protected]") | ||
user2 = self.backend.get_user("sync-1.0", "[email protected]") | ||
# They should have got a new uid. | ||
self.assertNotEqual(user2["uid"], user1["uid"]) | ||
# But their account metadata should have been preserved. | ||
self.assertEqual(user2["generation"], user1["generation"]) | ||
self.assertEqual(user2["keys_changed_at"], user1["keys_changed_at"]) | ||
self.assertEqual(user2["client_state"], user1["client_state"]) | ||
|
||
def test_node_reassignment_not_done_for_retired_users(self): | ||
|