def test_find_each_product(self): ReportData.drop_collection() count = 0 for key, value in products_dict.items(): count += 1 entry = TestData.create_entry(key, memhigh=True) entry.save(safe=True) lookup = len(ReportData.objects.all()) self.assertEqual(lookup, count) end = datetime.now() delta = timedelta(days=1) start = datetime.now() - delta for key, value in products_dict.items(): print(key) p = Product.objects.filter(name=key)[0] print(p.name) rhic = RHIC.objects.filter(uuid=value[1])[0] print(rhic.uuid) print(rhic.contract) results_dicts = Product_Def.get_product_match( p, rhic, start, end, rhic.contract, "us-east-1") self.assertEqual(len(results_dicts), 1)
def setUp(self): db_name = settings.MONGO_DATABASE_NAME_RESULTS self.db = connect(db_name) ReportData.drop_collection() rhel_product = TestData.create_products() rhel_entry = TestData.create_entry(RHEL, memhigh=True) rhel_entry.save()
def test_find_each_product(self): ReportData.drop_collection() count = 0 for key, value in products_dict.items(): count += 1 entry = TestData.create_entry(key, memhigh=True) entry.save(safe=True) lookup = len(ReportData.objects.all()) self.assertEqual(lookup, count) end = datetime.now() delta = timedelta(days=1) start = datetime.now() - delta for key, value in products_dict.items(): print(key) p = Product.objects.filter(name=key)[0] print(p.name) rhic = RHIC.objects.filter(uuid=value[1])[0] print(rhic.uuid) print(rhic.contract) results_dicts = Product_Def.get_product_match(p, rhic, start, end, rhic.contract, "us-east-1") self.assertEqual(len(results_dicts), 1)