def test_not_called_with_exclusions(self, _region_email_mock): self.app.addonexcludedregion.create(region=mkt.regions.UK.id) send_new_region_emails([mkt.regions.UK]) eq_(list(_region_email_mock.call_args_list[0][0][0]), [])
def test_not_called_with_enable_new_regions_false(self, _region_email_mock): """Check enable_new_regions is False by default.""" eq_(self.app.enable_new_regions, False) send_new_region_emails([mkt.regions.UK]) eq_(list(_region_email_mock.call_args_list[0][0][0]), [])
def test_not_called_with_future_exclusions(self, _region_email_mock): AddonExcludedRegion.objects.create(addon=self.app, region=mkt.regions.WORLDWIDE.id) send_new_region_emails([mkt.regions.CA]) eq_(list(_region_email_mock.call_args_list[0][0][0]), [])
def test_called(self, _region_email_mock): self.app.update(enable_new_regions=True) send_new_region_emails([mkt.regions.UK]) eq_(list(_region_email_mock.call_args_list[0][0][0]), [self.app.id])
def test_not_called_with_enable_new_regions_false(self, _region_email_mock): # Check enable_new_regions is False by default. eq_(self.app.enable_new_regions, False) send_new_region_emails([mkt.regions.UK]) eq_(list(_region_email_mock.call_args_list[0][0][0]), [])
def test_called(self, _region_email_mock): send_new_region_emails([mkt.regions.CA]) eq_(list(_region_email_mock.call_args_list[0][0][0]), [self.app.id])
def test_not_called_with_exclusions(self, _region_email_mock): AddonExcludedRegion.objects.create(addon=self.app, region=mkt.regions.UK.id) send_new_region_emails([mkt.regions.UK]) eq_(list(_region_email_mock.call_args_list[0][0][0]), [])
def test_not_called_with_enable_new_regions_false(self, _region_email_mock): """Check enable_new_regions is False by default.""" self.app.update(enable_new_regions=False) send_new_region_emails([mkt.regions.GBR]) eq_(list(_region_email_mock.call_args_list[0][0][0]), [])
def test_called(self, _region_email_mock): eq_(self.app.enable_new_regions, True) send_new_region_emails([mkt.regions.GBR]) eq_(list(_region_email_mock.call_args_list[0][0][0]), [self.app.id])