コード例 #1
0
	def test_get_associations(self):
		#ipad,iphone
		user_ids = self.request.user.id
		self.assertEqual(len(get_associations(user_ids)[self.request.user.id][ASSOCIATIONS_KEY_IOS]),2)
		#Android
		self.assn.platform = 'Android'
		self.assn.save(self.request)
		self.assertEqual(len(get_associations(user_ids)[self.request.user.id][ASSOCIATIONS_KEY_ANDROID]),1)
コード例 #2
0
	def test_get_associations2(self):
		#ipad,iphone
		user_ids = self.request.user.id
		associates = get_associations(user_ids, 
			support_version=TAB_CHANGE_SUPPORT_VERSION)[self.request.user.id]
		self.assertNotIn(ASSOCIATIONS_KEY_IOS, associates)
		#Android
		self.assn.platform = 'Android'
		self.assn.save(self.request)
		associates = get_associations(user_ids, 
			support_version=TAB_CHANGE_SUPPORT_VERSION)[self.request.user.id]
		self.assertNotIn(ASSOCIATIONS_KEY_ANDROID, associates)
コード例 #3
0
	def test_get_associations5(self):
		#ipad,iphone
		user_ids = self.request.user.id
		#Android
		self.assn.version = '1.42.01'
		self.assn.save(self.request)

		self.assn1.version = '1.42.02'
		self.assn1.save(self.assn1_request)
		associates = get_associations(user_ids, 
			support_version=TAB_CHANGE_SUPPORT_VERSION)[self.request.user.id]

		self.assertIn(ASSOCIATIONS_KEY_IOS, associates)
		self.assertEqual(len(associates[ASSOCIATIONS_KEY_IOS]),2)

		#Android
		self.assn.platform = 'Android'
		self.assn.version = '1.57.01'
		self.assn.save(self.request)
		associates = get_associations(user_ids, 
			support_version=TAB_CHANGE_SUPPORT_VERSION)[self.request.user.id]
		self.assertIn(ASSOCIATIONS_KEY_ANDROID, associates)
		self.assertEqual(len(associates[ASSOCIATIONS_KEY_ANDROID]),1)