Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add manager and description field to AutomationRule model #5995

Merged
merged 9 commits into from
Aug 26, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename method
stsewd committed Aug 14, 2019

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit 0b4d9dc57dfe8e6ed25274c271bc3e888e0a7b9d
2 changes: 1 addition & 1 deletion readthedocs/builds/managers.py
Original file line number Diff line number Diff line change
@@ -183,7 +183,7 @@ class ExternalBuildManager(SettingsOverrideObject):

class VersionAutomationRuleManager(PolymorphicManager):

def append_rule(
def add_rule(
self, *, project, description, match_arg, version_type,
action, action_arg=None,
):
8 changes: 4 additions & 4 deletions readthedocs/rtd_tests/tests/test_automation_rules.py
Original file line number Diff line number Diff line change
@@ -134,10 +134,10 @@ class TestAutomationRuleManager:
def setup_method(self):
self.project = get(Project)

def test_append_rule_regex(self):
def test_add_rule_regex(self):
assert not self.project.automation_rules.all()

rule = RegexAutomationRule.objects.append_rule(
rule = RegexAutomationRule.objects.add_rule(
project=self.project,
description='First rule',
match_arg='.*',
@@ -150,7 +150,7 @@ def test_append_rule_regex(self):
assert rule.priority == 0

# Adding a second rule
rule = RegexAutomationRule.objects.append_rule(
rule = RegexAutomationRule.objects.add_rule(
project=self.project,
description='Second rule',
match_arg='.*',
@@ -174,7 +174,7 @@ def test_append_rule_regex(self):
assert rule.priority == 9

# Adding a new rule
rule = RegexAutomationRule.objects.append_rule(
rule = RegexAutomationRule.objects.add_rule(
project=self.project,
description='Fourth rule',
match_arg='.*',