Пример #1
0
    def test_clear(self):
        node_settings = MenbibNodeSettingsFactory.build()
        user_settings = MenbibUserSettingsFactory(access_token='abcde')
        node_settings.user_settings = user_settings
        node_settings.save()

        assert_true(user_settings.access_token)
        user_settings.clear()
        user_settings.save()
        assert_false(user_settings.access_token)
Пример #2
0
 def test_to_json(self):
     user_settings = MenbibUserSettingsFactory()
     result = user_settings.to_json()
     assert_equal(result['has_auth'], user_settings.has_auth)
Пример #3
0
 def test_delete(self):
     user_settings = MenbibUserSettingsFactory(access_token='abcde')
     assert_true(user_settings.has_auth)
     user_settings.delete()
     user_settings.save()
     assert_false(user_settings.access_token)
Пример #4
0
 def test_has_auth(self):
     user_settings = MenbibUserSettingsFactory(access_token=None)
     assert_false(user_settings.has_auth)
     user_settings.access_token = '12345'
     user_settings.save()
     assert_true(user_settings.has_auth)