Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ox-it/talks.ox
Browse files Browse the repository at this point in the history
* 'master' of github.com:ox-it/talks.ox:
  Update error message when no title provided. #202
  Fix test to account for Add Talk > New Talk
  'Add Talk' > 'New Talk' #201
  • Loading branch information
martinfilliau committed Jan 13, 2015
2 parents 67d5dc4 + 25f3ef4 commit 299a843
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion talks/events/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def save(self):

def clean(self):
if not self.cleaned_data['title'] and not self.cleaned_data['title_not_announced']:
raise forms.ValidationError("Either provide title or mark it as not announced")
raise forms.ValidationError("Either provide the Title or mark it as TBA")
return self.cleaned_data

def _update_people(self, field, event, role):
Expand Down
10 changes: 5 additions & 5 deletions talks/events/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def test_title_blank(self):
errors = form.errors.as_data()
logging.info("form errors: %s", errors)
self.assertIn('__all__', form.errors)
self.assertIn("Either provide title or mark it as not announced", form.errors['__all__'])
self.assertIn("Either provide the Title or mark it as TBA", form.errors['__all__'])
self.assertNotIn('title', form.errors)
self.assertNotIn('title_not_announced', form.errors)

Expand All @@ -135,7 +135,7 @@ def test_title_not_announced_false(self):
form = forms.EventForm(data)
errors = form.errors.as_data()
logging.info("form errors: %s", errors)
self.assertNotIn("Either provide title or mark it as not announced", form.errors.get('__all__', []))
self.assertNotIn("Either provide the Title or mark it as TBA", form.errors.get('__all__', []))
self.assertNotIn('title', form.errors)
self.assertNotIn('title_not_announced', form.errors)

Expand All @@ -147,7 +147,7 @@ def test_title_not_announced_true_title_not_blank(self):
form = forms.EventForm(data)
errors = form.errors.as_data()
logging.info("form errors: %s", errors)
self.assertNotIn("Either provide title or mark it as not announced", form.errors.get('__all__', []))
self.assertNotIn("Either provide the Title or mark it as TBA", form.errors.get('__all__', []))
self.assertNotIn('title', form.errors)
self.assertNotIn('title_not_announced', form.errors)

Expand All @@ -159,7 +159,7 @@ def test_title_not_announced_true_title_blank(self):
form = forms.EventForm(data)
errors = form.errors.as_data()
logging.info("form errors: %s", errors)
self.assertNotIn("Either provide title or mark it as not announced", form.errors.get('__all__', []))
self.assertNotIn("Either provide the Title or mark it as TBA", form.errors.get('__all__', []))
self.assertNotIn('title', form.errors)
self.assertNotIn('title_not_announced', form.errors)

Expand Down Expand Up @@ -364,7 +364,7 @@ def test_get_happy_no_group_id(self):
self.assertEquals(response.status_code, 200)
self.assertTemplateUsed(response, 'events/event_form.html')
self.assertContains(response, "Oxford Talks")
self.assertContains(response, "Add Talk")
self.assertContains(response, "New Talk")
self.assertIn('event_form', response.context)

def test_get_nonexistent_group(self):
Expand Down
2 changes: 1 addition & 1 deletion talks/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<li {% ifequal request.path contributors_homepage %} class="active"{% endifequal %}><a href="{{ contributors_homepage }}">Dashboard</a></li>
{% endif %}
{% if perms.events.add_event %}
<li {% ifequal request.path create_event %} class="active" {% endifequal %}><a href="{{ create_event }}">Add Talk</a></li>
<li {% ifequal request.path create_event %} class="active" {% endifequal %}><a href="{{ create_event }}">New Talk</a></li>
{% endif %}
</ul>
<form class="navbar-form navbar-right" role="search" method="get" action="{% url 'haystack_search' %}">
Expand Down
2 changes: 1 addition & 1 deletion talks/templates/events/event_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h3>Edit "{{ event.title }}"</h3>
<h3>Edit Untitled Talk</h3>
{% endif %}
{% else %}
<h3>Add Talk</h3>
<h3>New Talk</h3>
{% endif %}
{% for error in event_form.non_field_errors %}
<div class="alert alert-warning" role="alert">{{ error }}</div>
Expand Down
2 changes: 1 addition & 1 deletion tests/add_talk.robot
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Scenario: Title not announced
${error message[0]} should be displayed
${error message[1]} should be displayed
${error message[0]} should contain text "Please correct errors below"
${error message[1]} should contain text "Either provide title or mark it as not announced"
${error message[1]} should contain text "Either provide the Title or mark it as TBA"

Scenario: Create new group on the go
go to ${add_talk_page}
Expand Down

0 comments on commit 299a843

Please sign in to comment.