-
Notifications
You must be signed in to change notification settings - Fork 378
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
feat: Create documents for rpc demo #6240
Merged
jennifer-richards
merged 9 commits into
ietf-tools:feat/rpc
from
jennifer-richards:rfctobe-demo
Aug 29, 2023
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1c65b05
chore: Remove unused import
jennifer-richards 708fb15
chore: Default to rfc_number=None in RfcToBeFactory
jennifer-richards d7df941
feat: First pass at next_rfc_number()
jennifer-richards 2c60513
chore: Rest of very early create_documents() method
jennifer-richards 235333f
chore: Remove unused import
jennifer-richards 0e1b1a0
test: Exercise next_rfc_number()
jennifer-richards 14c5f9b
fix: Handle absence of DocAlias in next_rfc_number()
jennifer-richards ad8c4ae
chore: Flesh out documents for rpc demo
jennifer-richards 08ce00e
chore: Define __str__ for a couple rpc models
jennifer-richards File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,35 @@ | ||
# Copyright The IETF Trust 2023, All Rights Reserved | ||
# -*- coding: utf-8 -*- | ||
from django.test import TestCase | ||
from ietf.doc.factories import DocAliasFactory | ||
from ietf.utils.test_utils import TestCase | ||
|
||
# Create your tests here. | ||
from .factories import RfcToBeFactory, UnusableRfcNumberFactory | ||
from .utils import next_rfc_number | ||
|
||
|
||
class UtilsTests(TestCase): | ||
def test_next_rfc_number(self): | ||
self.assertEqual(next_rfc_number(), [1]) | ||
self.assertEqual(next_rfc_number(2), [1, 2]) | ||
self.assertEqual(next_rfc_number(5), [1, 2, 3, 4, 5]) | ||
|
||
UnusableRfcNumberFactory(number=1) | ||
self.assertEqual(next_rfc_number(), [2]) | ||
self.assertEqual(next_rfc_number(2), [2, 3]) | ||
self.assertEqual(next_rfc_number(5), [2, 3, 4, 5, 6]) | ||
|
||
RfcToBeFactory(rfc_number=2) | ||
self.assertEqual(next_rfc_number(), [3]) | ||
self.assertEqual(next_rfc_number(2), [3, 4]) | ||
self.assertEqual(next_rfc_number(5), [3, 4, 5, 6, 7]) | ||
|
||
DocAliasFactory(name="rfc3") | ||
self.assertEqual(next_rfc_number(), [4]) | ||
self.assertEqual(next_rfc_number(2), [4, 5]) | ||
self.assertEqual(next_rfc_number(5), [4, 5, 6, 7, 8]) | ||
|
||
# next_rfc_number is not done until this one passes! | ||
# UnusableRfcNumberFactory(number=6) | ||
# self.assertEqual(next_rfc_number(), [4]) | ||
# self.assertEqual(next_rfc_number(2), [4, 5]) | ||
# self.assertEqual(next_rfc_number(5), [7, 8, 9, 10, 11]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
# Copyright The IETF Trust 2023, All Rights Reserved | ||
# -*- coding: utf-8 -*- | ||
from django.shortcuts import render | ||
|
||
# Create your views here. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😿