示例#1
0
	def test_authenticate_success(self):
		"""
		Test success
		"""
		result = authenticate(self.user.username, Dummies.get_password())

		self.assertEqual(result.is_succeed, True)
		self.assertEqual(result.data, User.objects.get(username='******'))
	def setUp(self):
		self.url = '/api/cmn/measure/'
		self.request_content_type = 'application/json'
		self.client = Client()

		measure = Dummies.get_or_create_measure()
		user = Dummies.get_or_create_user()
		self.client.login(username=user.username, password=Dummies.get_password())
示例#3
0
	def setUp(self):
		self.url = '/api/cmn/po/'
		self.request_content_type = 'application/json'
		self.client = Client()

		user = Dummies.get_or_create_user()
		po = Dummies.get_or_create_po()
		self.client.login(username=user.username, password=Dummies.get_password())
		self.key = 'po'
	def setUp(self):
		self.url = '/api/cmn/category/'
		self.request_content_type = 'application/json'
		self.client = Client()

		self.root_category_level = Dummies.get_or_create_root_category_level()
		self.user = Dummies.get_or_create_user()
		self.client.login(username=self.user.username, password=Dummies.get_password())
		self.root_category = Dummies.get_or_create_root_category()

		self.post_data = {
			'name': '',
			'parent_guid': ''
		}
	def setUp(self):
		self.url = '/api/cmn/transaction/'
		self.request_content_type = 'application/json'
		self.client = Client()

		self.user = Dummies.get_or_create_user()
		self.po = Dummies.get_or_create_po()
		self.transaction_status_success = Dummies.get_or_create_transaction_status('success')
		self.client.login(username = self.user.username, password = Dummies.get_password())
		self.key = 'transaction'

		self.new_transaction = {
			'date': 1462969764591,
			'value': '50000',
			'payment_object_id': self.po.guid
		}
	def setUp(self):
		self.url = '/api/cmn/expenseitem/'
		self.request_content_type = 'application/json'
		self.client = Client()

		self.measure = Dummies.get_or_create_measure()
		self.category = Dummies.get_or_create_root_category()
		self.supplier = Dummies.get_or_create_supplier()
		self.currency = Dummies.get_or_create_currency()
		self.user = Dummies.get_or_create_user()
		self.client.login(username=self.user.username, password=Dummies.get_password())

		self.post_data = {
			'name': 'test_1',
			'description': 'test description',
			'currency_id': self.currency.guid,
			'measure_id': self.measure.guid,
			'category_id': self.category.guid,
		}
	def setUp(self):
		self.url = '/api/cmn/transaction/'
		self.request_content_type = 'application/json'
		self.client = Client()

		self.user = Dummies.get_or_create_user()
		self.po = Dummies.get_or_create_po()
		self.transaction_status_success = Dummies.get_or_create_transaction_status('success')
		self.transaction_status_success = Dummies.get_or_create_transaction_status('error')
		self.supplier = Dummies.get_or_create_supplier()
		self.expense_item = Dummies.get_or_create_expense_item()

		self.client.login(username = self.user.username, password = Dummies.get_password())
		self.key = 'transaction'

		self.new_transaction = {
			'date': int(time.time()) * 100,
			'supplier_id': self.supplier.guid,
			'payment_object_id': self.po.guid,
			'expense_items': []
		}