def test_is_interesting(self): p = scrum_models.Project.objects.get(pk=1) comp = p.products.create(name="Websites", component="Scrumbugs") for msg in scrum_email.get_bugmails().values(): ok_(scrum_email.is_interesting(msg)) comp.delete() scrum_models.BZProduct.objects._reset_full_list() for msg in scrum_email.get_bugmails().values(): ok_(not scrum_email.is_interesting(msg)) p.products.create(name="Websites") scrum_models.BZProduct.objects._reset_full_list() for msg in scrum_email.get_bugmails().values(): ok_(scrum_email.is_interesting(msg))
def test_not_is_interesting(self): for msg in scrum_email.get_bugmails().values(): print scrum_email.is_interesting(msg) ok_(not scrum_email.is_interesting(msg)) p = scrum_models.Project.objects.get(pk=1) p.products.create(name='Input', component=scrum_models.ALL_COMPONENTS) scrum_models.BZProduct.objects._reset_full_list() for msg in scrum_email.get_bugmails().values(): ok_(not scrum_email.is_interesting(msg)) p.products.create(name='Websites', component='Betafarm') scrum_models.BZProduct.objects._reset_full_list() for msg in scrum_email.get_bugmails().values(): ok_(not scrum_email.is_interesting(msg))
def test_not_is_interesting(self): for msg in scrum_email.get_bugmails().values(): print scrum_email.is_interesting(msg) ok_(not scrum_email.is_interesting(msg)) p = scrum_models.Project.objects.get(pk=1) p.products.create(name="Input") scrum_models.BZProduct.objects._reset_full_list() for msg in scrum_email.get_bugmails().values(): ok_(not scrum_email.is_interesting(msg)) p.products.create(name="Websites", component="Betafarm") scrum_models.BZProduct.objects._reset_full_list() for msg in scrum_email.get_bugmails().values(): ok_(not scrum_email.is_interesting(msg))
def test_is_interesting(self): p = scrum_models.Project.objects.get(pk=1) comp = p.products.create(name='Websites', component='Scrumbugs') for msg in scrum_email.get_bugmails().values(): ok_(scrum_email.is_interesting(msg)) comp.delete() scrum_models.BZProduct.objects._reset_full_list() for msg in scrum_email.get_bugmails().values(): ok_(not scrum_email.is_interesting(msg)) p.products.create(name='Websites', component=scrum_models.ALL_COMPONENTS) scrum_models.BZProduct.objects._reset_full_list() for msg in scrum_email.get_bugmails().values(): ok_(scrum_email.is_interesting(msg))
def get_bugmail_messages(): """ Check bugmail for updated bugs, and get their data from Bugzilla. """ msgs = get_bugmails() bugids = store_messages(msgs) if bugids: update_bugs.delay(bugids)
def get_bugmail_messages(): """ Check bugmail for updated bugs, and get their data from Bugzilla. """ msgs = get_bugmails() if msgs: for bid, msg in msgs.iteritems(): bug_data = extract_bug_info(msg) bug, created = Bug.objects.get_or_create(id=bid, defaults=bug_data) if not created: for attr, val in bug_data.items(): setattr(bug, attr, val) bug.save() bugids = msgs.keys() update_bugs.delay(bugids) log.info('Synced %d bug(s) from email', len(bugids))
def test_get_bugmails(self): good_data = [760693, 760694] eq_(good_data, sorted(scrum_email.get_bugmails().keys()))
def test_get_bugmails(self): good_data = [760693, 760694] p = scrum_models.Project.objects.get(pk=1) p.products.create(name='Websites', component='Scrumbugs') scrum_models.BZProduct.objects._reset_full_list() eq_(good_data, sorted(scrum_email.get_bugmails().keys()))